Completed
Pull Request — master (#332)
by Alexander M.
34:09
created
lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $this->assertValidKey($key);
62 62
 
63 63
         return isset($this->deferredItems[$key])
64
-            ? !$this->isExpired($this->deferredItems[$key])
64
+            ? ! $this->isExpired($this->deferredItems[$key])
65 65
             : $this->cache->contains($key)
66 66
         ;
67 67
     }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             return $this->cache->delete($item->getKey());
113 113
         }
114 114
 
115
-        return $this->cache->save($item->getKey(), $item->get(), !$item instanceof CacheItem || null === $item->getExpiration() ? 0 : $item->getExpiration()->getTimestamp() - time());
115
+        return $this->cache->save($item->getKey(), $item->get(), ! $item instanceof CacheItem || null === $item->getExpiration() ? 0 : $item->getExpiration()->getTimestamp() - time());
116 116
     }
117 117
 
118 118
     /**
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
      */
135 135
     public function commit(): bool
136 136
     {
137
-        $success =  $this->cache->saveMultiple(array_map(
138
-            static function (CacheItemInterface $cacheItem) {
137
+        $success = $this->cache->saveMultiple(array_map(
138
+            static function(CacheItemInterface $cacheItem) {
139 139
                 return $cacheItem->get();
140 140
             },
141 141
             $this->deferredItems
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
     private function assertValidKey($key): void
157 157
     {
158
-        if (!\is_string($key) || '' === $key || preg_match('#[\{\}\(\)/\\\\@:]#', $key)) {
158
+        if ( ! \is_string($key) || '' === $key || preg_match('#[\{\}\(\)/\\\\@:]#', $key)) {
159 159
             throw new InvalidArgumentException('Invalid cache key.');
160 160
         }
161 161
     }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/Psr6/CacheItem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
      */
62 62
     public function expiresAt($expiration): self
63 63
     {
64
-        if (null !== $expiration && !$expiration instanceof \DateTimeInterface) {
64
+        if (null !== $expiration && ! $expiration instanceof \DateTimeInterface) {
65 65
             throw new \TypeError(sprintf(
66 66
                 'Expected $expiration to be an instance of DateTimeInterface or null, got %s',
67 67
                 \is_object($expiration) ? \get_class($expiration) : \gettype($expiration)
Please login to merge, or discard this patch.