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

nette / caching / 6311829630

26 Sep 2023 11:12AM UTC coverage: 88.889%. Remained the same
6311829630

push

github

dg
removed Nette\SmartObject

536 of 603 relevant lines covered (88.89%)

0.89 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
        private array $data = [];
21

22

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

28

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

33

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

39

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

45

46
        public function clean(array $conditions): void
47
        {
48
                if (!empty($conditions[Nette\Caching\Cache::All])) {
×
49
                        $this->data = [];
×
50
                }
51
        }
52
}
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