• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nette / caching / 20835655444

08 Jan 2026 11:36PM UTC coverage: 87.202%. Remained the same
20835655444

push

github

dg
used attribute Deprecated

586 of 672 relevant lines covered (87.2%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/src/Caching/Storages/MemoryStorage.php
1
<?php
2

3
/**
4
 * This file is part of the Nette Framework (https://nette.org)
5
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
 */
7

8
declare(strict_types=1);
9

10
namespace Nette\Caching\Storages;
11

12
use Nette;
13

14

15
/**
16
 * Memory cache storage.
17
 */
18
class MemoryStorage implements Nette\Caching\Storage
19
{
20
        /** @var array<string, mixed>  key => cached value */
21
        private array $data = [];
22

23

24
        public function read(string $key): mixed
1✔
25
        {
26
                return $this->data[$key] ?? null;
1✔
27
        }
28

29

30
        public function lock(string $key): void
31
        {
32
        }
33

34

35
        public function write(string $key, $data, array $dependencies): void
1✔
36
        {
37
                $this->data[$key] = $data;
1✔
38
        }
1✔
39

40

41
        public function remove(string $key): void
42
        {
43
                unset($this->data[$key]);
×
44
        }
45

46

47
        public function clean(array $conditions): void
48
        {
49
                if (!empty($conditions[Nette\Caching\Cache::All])) {
×
50
                        $this->data = [];
×
51
                }
52
        }
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc