Submit
Path:
~
/
home
/
sbfocnqg
/
public_html
/
myadmin
/
vendor
/
phpmyadmin
/
motranslator
/
src
/
Cache
/
File Content:
InMemoryCache.php
<?php declare(strict_types=1); namespace PhpMyAdmin\MoTranslator\Cache; use PhpMyAdmin\MoTranslator\MoParser; use function array_key_exists; final class InMemoryCache implements CacheInterface, GetAllInterface { /** @var array<string, string> */ private $cache; public function __construct(MoParser $parser) { $this->cache = []; $parser->parseIntoCache($this); } public function get(string $msgid): string { return array_key_exists($msgid, $this->cache) ? $this->cache[$msgid] : $msgid; } public function set(string $msgid, string $msgstr): void { $this->cache[$msgid] = $msgstr; } public function has(string $msgid): bool { return array_key_exists($msgid, $this->cache); } public function setAll(array $translations): void { $this->cache = $translations; } /** * @inheritDoc */ public function getAll(): array { return $this->cache; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
ApcuCache.php
3811 bytes
0644
ApcuCacheFactory.php
741 bytes
0644
CacheFactoryInterface.php
249 bytes
0644
CacheInterface.php
832 bytes
0644
GetAllInterface.php
195 bytes
0644
InMemoryCache.php
999 bytes
0644
N4ST4R_ID | Naxtarrr