These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the Ivory Http Adapter package. |
||
5 | * |
||
6 | * (c) Eric GELOEN <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please read the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Ivory\HttpAdapter\Event\Cache\Adapter; |
||
13 | |||
14 | use Stash\Pool; |
||
15 | |||
16 | /** |
||
17 | * @author GeLo <[email protected]> |
||
18 | */ |
||
19 | class StashCacheAdapter implements CacheAdapterInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var Pool |
||
23 | */ |
||
24 | private $pool; |
||
25 | |||
26 | /** |
||
27 | * @param Pool $pool |
||
28 | */ |
||
29 | 45 | public function __construct(Pool $pool) |
|
30 | { |
||
31 | 45 | $this->pool = $pool; |
|
32 | 45 | } |
|
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 9 | public function has($id) |
|
38 | { |
||
39 | 9 | return !$this->pool->getItem($id)->isMiss(); |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 9 | public function get($id) |
|
46 | { |
||
47 | 9 | return $this->pool->getItem($id)->get(); |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | 9 | public function set($id, $data, $lifeTime = 0) |
|
54 | { |
||
55 | 9 | $result = $this->pool->getItem($id)->set($data, $lifeTime); |
|
56 | 9 | $this->pool->flush(); |
|
0 ignored issues
–
show
|
|||
57 | |||
58 | 9 | return $result; |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 9 | public function remove($id) |
|
65 | { |
||
66 | 9 | $result = $this->pool->getItem($id)->clear(); |
|
67 | 9 | $this->pool->flush(); |
|
0 ignored issues
–
show
The method
flush() does not seem to exist on object<Stash\Pool> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||
68 | |||
69 | 9 | return $result; |
|
70 | } |
||
71 | } |
||
72 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.