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

nette / caching / 3925853938

pending completion
3925853938

push

github

David Grudl
typo

539 of 604 relevant lines covered (89.24%)

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
        use Nette\SmartObject;
21

22
        /** @var array */
23
        private $data = [];
24

25

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

31

32
        public function lock(string $key): void
33
        {
34
        }
35

36

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

42

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

48

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