1 | <?php |
||
19 | trait ItemBaseTrait |
||
20 | { |
||
21 | use ItemExtendedTrait; |
||
22 | |||
23 | /** |
||
24 | * @var bool |
||
25 | */ |
||
26 | protected $fetched = false; |
||
27 | |||
28 | /** |
||
29 | * @var phpFastCacheAbstractProxy |
||
30 | */ |
||
31 | protected $driver; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $key; |
||
37 | |||
38 | /** |
||
39 | * @var mixed |
||
40 | */ |
||
41 | protected $data; |
||
42 | |||
43 | /** |
||
44 | * @var \DateTime |
||
45 | */ |
||
46 | protected $expirationDate; |
||
47 | |||
48 | /** |
||
49 | * @var \DateTime |
||
50 | */ |
||
51 | protected $creationDate; |
||
52 | |||
53 | /** |
||
54 | * @var \DateTime |
||
55 | */ |
||
56 | protected $modificationDate; |
||
57 | |||
58 | /** |
||
59 | * @var array |
||
60 | */ |
||
61 | protected $tags = []; |
||
62 | |||
63 | /** |
||
64 | * @var array |
||
65 | */ |
||
66 | protected $removedTags = []; |
||
67 | |||
68 | /** |
||
69 | * @var bool |
||
70 | */ |
||
71 | protected $isHit = false; |
||
72 | |||
73 | /******************** |
||
74 | * |
||
75 | * PSR-6 Methods |
||
76 | * |
||
77 | *******************/ |
||
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getKey() |
||
86 | |||
87 | /** |
||
88 | * @return mixed |
||
89 | */ |
||
90 | public function get() |
||
94 | |||
95 | /** |
||
96 | * @param mixed $value |
||
97 | * @return $this |
||
98 | */ |
||
99 | public function set($value) |
||
119 | |||
120 | /** |
||
121 | * @return bool |
||
122 | * @throws \InvalidArgumentException |
||
123 | */ |
||
124 | public function isHit() |
||
128 | |||
129 | /** |
||
130 | * @param bool $isHit |
||
131 | * @return $this |
||
132 | * @throws \InvalidArgumentException |
||
133 | */ |
||
134 | public function setHit($isHit) |
||
144 | |||
145 | /** |
||
146 | * @param \DateTimeInterface $expiration |
||
147 | * @return $this |
||
148 | * @throws \InvalidArgumentException |
||
149 | */ |
||
150 | public function expiresAt($expiration) |
||
166 | |||
167 | /** |
||
168 | * Sets the expiration time for this cache item. |
||
169 | * |
||
170 | * @param int|\DateInterval $time |
||
171 | * The period of time from the present after which the item MUST be considered |
||
172 | * expired. An integer parameter is understood to be the time in seconds until |
||
173 | * expiration. If null is passed explicitly, a default value MAY be used. |
||
174 | * If none is set, the value should be stored permanently or for as long as the |
||
175 | * implementation allows. |
||
176 | * |
||
177 | * @return static |
||
178 | * The called object. |
||
179 | * |
||
180 | * @deprecated Use CacheItemInterface::expiresAfter() instead |
||
181 | */ |
||
182 | public function touch($time) |
||
188 | |||
189 | /** |
||
190 | * @param \DateInterval|int $time |
||
191 | * @return $this |
||
192 | * @throws \InvalidArgumentException |
||
193 | */ |
||
194 | public function expiresAfter($time) |
||
228 | } |
||
229 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.