@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Item constructor. |
32 | - * @param \phpFastCache\Drivers\Apc\Driver $driver |
|
32 | + * @param Driver $driver |
|
33 | 33 | * @param $key |
34 | 34 | * @throws \InvalidArgumentException |
35 | 35 | */ |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function getCreationDate() |
69 | 69 | { |
70 | - if($this->driver->getConfig()['itemDetailedDate']){ |
|
70 | + if ($this->driver->getConfig()['itemDetailedDate']) { |
|
71 | 71 | return $this->creationDate; |
72 | - }else{ |
|
72 | + } else { |
|
73 | 73 | throw new \LogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.'); |
74 | 74 | } |
75 | 75 | } |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function setCreationDate(\DateTimeInterface $date) |
83 | 83 | { |
84 | - if($this->driver->getConfig()['itemDetailedDate']){ |
|
84 | + if ($this->driver->getConfig()['itemDetailedDate']) { |
|
85 | 85 | $this->creationDate = $date; |
86 | 86 | return $this; |
87 | - }else{ |
|
87 | + } else { |
|
88 | 88 | throw new \LogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.'); |
89 | 89 | } |
90 | 90 | } |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function getModificationDate() |
97 | 97 | { |
98 | - if($this->driver->getConfig()['itemDetailedDate']){ |
|
98 | + if ($this->driver->getConfig()['itemDetailedDate']) { |
|
99 | 99 | return $this->modificationDate; |
100 | - }else{ |
|
100 | + } else { |
|
101 | 101 | throw new \LogicException('Cannot access to the modification date when the "itemDetailedDate" configuration is disabled.'); |
102 | 102 | } |
103 | 103 | } |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function setModificationDate(\DateTimeInterface $date) |
111 | 111 | { |
112 | - if($this->driver->getConfig()['itemDetailedDate']){ |
|
112 | + if ($this->driver->getConfig()['itemDetailedDate']) { |
|
113 | 113 | $this->modificationDate = $date; |
114 | 114 | return $this; |
115 | - }else{ |
|
115 | + } else { |
|
116 | 116 | throw new \LogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.'); |
117 | 117 | } |
118 | 118 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | public function removeTag($tagName) |
280 | 280 | { |
281 | 281 | if (($key = array_search($tagName, $this->tags)) !== false) { |
282 | - unset($this->tags[ $key ]); |
|
282 | + unset($this->tags[$key]); |
|
283 | 283 | $this->removedTags[] = $tagName; |
284 | 284 | } |
285 | 285 | |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | final public function __debugInfo() |
346 | 346 | { |
347 | 347 | $info = get_object_vars($this); |
348 | - $info[ 'driver' ] = 'object(' . get_class($info[ 'driver' ]) . ')'; |
|
348 | + $info['driver'] = 'object(' . get_class($info['driver']) . ')'; |
|
349 | 349 | |
350 | 350 | return (array) $info; |
351 | 351 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | if($this->driver->getConfig()['itemDetailedDate']){ |
71 | 71 | return $this->creationDate; |
72 | - }else{ |
|
72 | + } else{ |
|
73 | 73 | throw new \LogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.'); |
74 | 74 | } |
75 | 75 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | if($this->driver->getConfig()['itemDetailedDate']){ |
85 | 85 | $this->creationDate = $date; |
86 | 86 | return $this; |
87 | - }else{ |
|
87 | + } else{ |
|
88 | 88 | throw new \LogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.'); |
89 | 89 | } |
90 | 90 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | { |
98 | 98 | if($this->driver->getConfig()['itemDetailedDate']){ |
99 | 99 | return $this->modificationDate; |
100 | - }else{ |
|
100 | + } else{ |
|
101 | 101 | throw new \LogicException('Cannot access to the modification date when the "itemDetailedDate" configuration is disabled.'); |
102 | 102 | } |
103 | 103 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if($this->driver->getConfig()['itemDetailedDate']){ |
113 | 113 | $this->modificationDate = $date; |
114 | 114 | return $this; |
115 | - }else{ |
|
115 | + } else{ |
|
116 | 116 | throw new \LogicException('Cannot access to the creation date when the "itemDetailedDate" configuration is disabled.'); |
117 | 117 | } |
118 | 118 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function getItemsAsJsonString(array $keys = [], $option = 0, $depth = 512) |
31 | 31 | { |
32 | - $callback = function(CacheItemInterface $item){ |
|
32 | + $callback = function(CacheItemInterface $item) { |
|
33 | 33 | return $item->get(); |
34 | 34 | }; |
35 | 35 | return json_encode(array_map($callback, array_values($this->getItems($keys))), $option, $depth); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getItemsByTagsAsJsonString(array $tagNames, $option = 0, $depth = 512) |
89 | 89 | { |
90 | - $callback = function(CacheItemInterface $item){ |
|
90 | + $callback = function(CacheItemInterface $item) { |
|
91 | 91 | return $item->get(); |
92 | 92 | }; |
93 | 93 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | return true; |
28 | 28 | } else if (constant($CONSTANT_NAME) !== $driverName) { |
29 | 29 | trigger_error('Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours', |
30 | - E_USER_WARNING); |
|
30 | + E_USER_WARNING); |
|
31 | 31 | |
32 | 32 | return false; |
33 | 33 | } |