PHP 8.2.31
Preview: PSRArrayCache.php Size: 1.76 KB
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Doctrine/PSRArrayCache.php

<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace MailPoet\Doctrine;

if (!defined('ABSPATH')) exit;


use MailPoetVendor\Psr\Cache\CacheItemInterface;
use MailPoetVendor\Psr\Cache\CacheItemPoolInterface;

class PSRArrayCache implements CacheItemPoolInterface {
  /** @var mixed[] */
  private $cache = [];

  /**
   * @inheritDoc
   */
  public function getItem($key) {
    if (!is_string($key)) {
      throw new PSRCacheInvalidArgumentException('Invalid key');
    }
    if (!$this->hasItem($key)) {
      return new PSRCacheItem($key, false);
    }
    return new PSRCacheItem($key, $this->cache[$key]);
  }

  public function getItems(array $keys = []) {
    return array_map([$this, 'getItem'], $keys);
  }

  /**
   * @inheritDoc
   */
  public function hasItem($key) {
    return array_key_exists($key, $this->cache);
  }

  /**
   * @inheritDoc
   */
  public function clear() {
    $this->cache = [];
    return true;
  }

  /**
   * @inheritDoc
   */
  public function deleteItem($key) {
    if (!is_string($key)) {
      throw new PSRCacheInvalidArgumentException('Invalid key');
    }
    unset($this->cache[$key]);
    return true;
  }

  /**
   * @inheritDoc
   */
  public function deleteItems(array $keys) {
    try {
      array_map([$this, 'deleteItem'], $keys);
    } catch (PSRCacheInvalidArgumentException $e) {
      return false;
    }
    return true;
  }

  /**
   * @inheritDoc
   */
  public function save(CacheItemInterface $item) {
    $this->cache[$item->getKey()] = $item->get();
    return true;
  }

  /**
   * @inheritDoc
   */
  public function saveDeferred(CacheItemInterface $item) {
    return $this->save($item);
  }

  /**
   * @inheritDoc
   */
  public function commit() {
    return true;
  }
}

Directory Contents

Dirs: 5 × Files: 15

Name Size Perms Modified Actions
- drwxr-xr-x 2023-04-04 05:35:40
Edit Download
- drwxr-xr-x 2023-04-04 05:35:40
Edit Download
- drwxr-xr-x 2023-04-04 05:35:40
Edit Download
Types DIR
- drwxr-xr-x 2023-04-04 05:35:40
Edit Download
Validator DIR
- drwxr-xr-x 2023-04-04 05:35:40
Edit Download
2.01 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.67 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
2.70 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
3.65 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
3.62 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
0 B lrw-r--r-- 2023-04-04 05:35:40
Edit Download
2.65 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.11 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.76 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
319 B lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.09 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
2.34 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
3.27 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.03 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
2.56 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).