Completed
Pull Request — master (#155)
by Benoît
04:01
created
lib/Doctrine/Common/Cache/RiakCache.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 namespace Doctrine\Common\Cache;
21 21
 
22 22
 use Riak\Bucket;
23
-use Riak\Connection;
24 23
 use Riak\Input;
25 24
 use Riak\Exception;
26 25
 use Riak\Object;
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/SQLite3Cache.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     /**
157 157
      * Find a single row by ID.
158 158
      *
159
-     * @param mixed $id
159
+     * @param string $id
160 160
      * @param bool $includeData
161 161
      *
162 162
      * @return array|null
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     /**
198 198
      * Gets an array of the fields in our table.
199 199
      *
200
-     * @return array
200
+     * @return string[]
201 201
      */
202 202
     private function getFields()
203 203
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
     {
166 166
         list($idField) = $fields = $this->getFields();
167 167
 
168
-        if (!$includeData) {
168
+        if ( ! $includeData) {
169 169
             $key = array_search(static::DATA_FIELD, $fields);
170 170
             unset($fields[$key]);
171 171
         }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/ApcCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
 
103 103
         // @TODO - Temporary fix @see https://github.com/krakjoe/apcu/pull/42
104 104
         if (PHP_VERSION_ID >= 50500) {
105
-            $info['num_hits']   = isset($info['num_hits'])   ? $info['num_hits']   : $info['nhits'];
105
+            $info['num_hits']   = isset($info['num_hits']) ? $info['num_hits'] : $info['nhits'];
106 106
             $info['num_misses'] = isset($info['num_misses']) ? $info['num_misses'] : $info['nmisses'];
107 107
             $info['start_time'] = isset($info['start_time']) ? $info['start_time'] : $info['stime'];
108 108
         }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/ArrayCache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     protected function doFetch($id)
67 67
     {
68
-        if (! $this->doContains($id)) {
68
+        if ( ! $this->doContains($id)) {
69 69
             $this->missesCount += 1;
70 70
 
71 71
             return false;
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     protected function doContains($id)
83 83
     {
84
-        if (! isset($this->data[$id])) {
84
+        if ( ! isset($this->data[$id])) {
85 85
             return false;
86 86
         }
87 87
 
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/CouchbaseCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
         $stats   = $this->couchbase->getStats();
109 109
         $servers = $this->couchbase->getServers();
110 110
         $server  = explode(":", $servers[0]);
111
-        $key     = $server[0] . ":" . "11210";
111
+        $key     = $server[0].":"."11210";
112 112
         $stats   = $stats[$key];
113 113
         return array(
114 114
             Cache::STATS_HITS   => $stats['get_hits'],
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/FileCache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             // And there is a bug in PHP (https://bugs.php.net/bug.php?id=70943) with path lengths of 259.
145 145
             // So if the id in hex representation would surpass the limit, we use the hash instead. The prefix prevents
146 146
             // collisions between the hash and bin2hex.
147
-            $filename = '_' . $hash;
147
+            $filename = '_'.$hash;
148 148
         } else {
149 149
             $filename = bin2hex($id);
150 150
         }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     {
196 196
         $usage = 0;
197 197
         foreach ($this->getIterator() as $name => $file) {
198
-            if (! $file->isDir() && $this->isFilenameEndingWithExtension($name)) {
198
+            if ( ! $file->isDir() && $this->isFilenameEndingWithExtension($name)) {
199 199
                 $usage += $file->getSize();
200 200
             }
201 201
         }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     private function createPathIfNeeded($path)
221 221
     {
222 222
         if ( ! is_dir($path)) {
223
-            if (false === @mkdir($path, 0777 & (~$this->umask), true) && !is_dir($path)) {
223
+            if (false === @mkdir($path, 0777 & (~$this->umask), true) && ! is_dir($path)) {
224 224
                 return false;
225 225
             }
226 226
         }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/FilesystemCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,6 +106,6 @@
 block discarded – undo
106 106
         $data      = serialize($data);
107 107
         $filename  = $this->getFilename($id);
108 108
 
109
-        return $this->writeFile($filename, $lifeTime . PHP_EOL . $data);
109
+        return $this->writeFile($filename, $lifeTime.PHP_EOL.$data);
110 110
     }
111 111
 }
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/MemcachedCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
     {
134 134
         $stats   = $this->memcached->getStats();
135 135
         $servers = $this->memcached->getServerList();
136
-        $key     = $servers[0]['host'] . ':' . $servers[0]['port'];
136
+        $key     = $servers[0]['host'].':'.$servers[0]['port'];
137 137
         $stats   = $stats[$key];
138 138
         return array(
139 139
             Cache::STATS_HITS   => $stats['get_hits'],
Please login to merge, or discard this patch.
lib/Doctrine/Common/Cache/PhpFileCache.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $value = $this->includeFileForId($id);
46 46
 
47
-        if (! $value) {
47
+        if ( ! $value) {
48 48
             return false;
49 49
         }
50 50
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     {
63 63
         $value = $this->includeFileForId($id);
64 64
 
65
-        if (! $value) {
65
+        if ( ! $value) {
66 66
             return false;
67 67
         }
68 68
 
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
 
81 81
         if (is_object($data) && ! method_exists($data, '__set_state')) {
82 82
             throw new \InvalidArgumentException(
83
-                "Invalid argument given, PhpFileCache only allows objects that implement __set_state() " .
84
-                "and fully support var_export(). You can use the FilesystemCache to save arbitrary object " .
83
+                "Invalid argument given, PhpFileCache only allows objects that implement __set_state() ".
84
+                "and fully support var_export(). You can use the FilesystemCache to save arbitrary object ".
85 85
                 "graphs using serialize()/deserialize()."
86 86
             );
87 87
         }
88 88
 
89
-        $filename  = $this->getFilename($id);
89
+        $filename = $this->getFilename($id);
90 90
 
91 91
         $value = array(
92 92
             'lifetime'  => $lifeTime,
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         // note: error suppression is still faster than `file_exists`, `is_file` and `is_readable`
112 112
         $value = @include $fileName;
113 113
 
114
-        if (! isset($value['lifetime'])) {
114
+        if ( ! isset($value['lifetime'])) {
115 115
             return false;
116 116
         }
117 117
 
Please login to merge, or discard this patch.