Passed
Pull Request — master (#351)
by Grégoire
02:26
created
lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function getClassAnnotations(ReflectionClass $class)
47 47
     {
48
-        return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName());
48
+        return $this->parser->parse($class->getDocComment(), 'class '.$class->getName());
49 49
     }
50 50
 
51 51
     /**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function getMethodAnnotations(ReflectionMethod $method)
55 55
     {
56
-        return $this->parser->parse($method->getDocComment(), 'method ' . $method->getDeclaringClass()->name . '::' . $method->getName() . '()');
56
+        return $this->parser->parse($method->getDocComment(), 'method '.$method->getDeclaringClass()->name.'::'.$method->getName().'()');
57 57
     }
58 58
 
59 59
     /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function getPropertyAnnotations(ReflectionProperty $property)
63 63
     {
64
-        return $this->parser->parse($property->getDocComment(), 'property ' . $property->getDeclaringClass()->name . '::$' . $property->getName());
64
+        return $this->parser->parse($property->getDocComment(), 'property '.$property->getDeclaringClass()->name.'::$'.$property->getName());
65 65
     }
66 66
 
67 67
     /**
Please login to merge, or discard this patch.
lib/Doctrine/Common/Annotations/Annotation/Enum.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function __construct(array $values)
42 42
     {
43
-        if (! isset($values['literal'])) {
43
+        if (!isset($values['literal'])) {
44 44
             $values['literal'] = [];
45 45
         }
46 46
 
47 47
         foreach ($values['value'] as $var) {
48
-            if (! is_scalar($var)) {
48
+            if (!is_scalar($var)) {
49 49
                 throw new InvalidArgumentException(sprintf(
50 50
                     '@Enum supports only scalar values "%s" given.',
51 51
                     is_object($var) ? get_class($var) : gettype($var)
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         }
55 55
 
56 56
         foreach ($values['literal'] as $key => $var) {
57
-            if (! in_array($key, $values['value'])) {
57
+            if (!in_array($key, $values['value'])) {
58 58
                 throw new InvalidArgumentException(sprintf(
59 59
                     'Undefined enumerator value "%s" for literal "%s".',
60 60
                     $key,
Please login to merge, or discard this patch.
lib/Doctrine/Common/Annotations/Annotation/Target.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function __construct(array $values)
62 62
     {
63
-        if (! isset($values['value'])) {
63
+        if (!isset($values['value'])) {
64 64
             $values['value'] = null;
65 65
         }
66 66
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             $values['value'] = [$values['value']];
69 69
         }
70 70
 
71
-        if (! is_array($values['value'])) {
71
+        if (!is_array($values['value'])) {
72 72
             throw new InvalidArgumentException(
73 73
                 sprintf(
74 74
                     '@Target expects either a string value, or an array of strings, "%s" given.',
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         $bitmask = 0;
81 81
         foreach ($values['value'] as $literal) {
82
-            if (! isset(self::$map[$literal])) {
82
+            if (!isset(self::$map[$literal])) {
83 83
                 throw new InvalidArgumentException(
84 84
                     sprintf(
85 85
                         'Invalid Target "%s". Available targets: [%s]',
Please login to merge, or discard this patch.
lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             $values['value'] = [$values['value']];
32 32
         }
33 33
 
34
-        if (! is_array($values['value'])) {
34
+        if (!is_array($values['value'])) {
35 35
             throw new RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value'])));
36 36
         }
37 37
 
Please login to merge, or discard this patch.
lib/Doctrine/Common/Annotations/CachedReader.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     public function getPropertyAnnotations(ReflectionProperty $property)
84 84
     {
85 85
         $class    = $property->getDeclaringClass();
86
-        $cacheKey = $class->getName() . '$' . $property->getName();
86
+        $cacheKey = $class->getName().'$'.$property->getName();
87 87
 
88 88
         if (isset($this->loadedAnnotations[$cacheKey])) {
89 89
             return $this->loadedAnnotations[$cacheKey];
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     public function getMethodAnnotations(ReflectionMethod $method)
118 118
     {
119 119
         $class    = $method->getDeclaringClass();
120
-        $cacheKey = $class->getName() . '#' . $method->getName();
120
+        $cacheKey = $class->getName().'#'.$method->getName();
121 121
 
122 122
         if (isset($this->loadedAnnotations[$cacheKey])) {
123 123
             return $this->loadedAnnotations[$cacheKey];
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     private function fetchFromCache($cacheKey, ReflectionClass $class)
167 167
     {
168 168
         if (($data = $this->cache->fetch($cacheKey)) !== false) {
169
-            if (! $this->debug || $this->isCacheFresh($cacheKey, $class)) {
169
+            if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) {
170 170
                 return $data;
171 171
             }
172 172
         }
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
     private function saveToCache($cacheKey, $value)
186 186
     {
187 187
         $this->cache->save($cacheKey, $value);
188
-        if (! $this->debug) {
188
+        if (!$this->debug) {
189 189
             return;
190 190
         }
191 191
 
192
-        $this->cache->save('[C]' . $cacheKey, time());
192
+        $this->cache->save('[C]'.$cacheKey, time());
193 193
     }
194 194
 
195 195
     /**
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             return true;
207 207
         }
208 208
 
209
-        return $this->cache->fetch('[C]' . $cacheKey) >= $lastModification;
209
+        return $this->cache->fetch('[C]'.$cacheKey) >= $lastModification;
210 210
     }
211 211
 
212 212
     /**
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
         $parent = $class->getParentClass();
226 226
 
227
-        $lastModification =  max(array_merge(
227
+        $lastModification = max(array_merge(
228 228
             [$filename ? filemtime($filename) : 0],
229 229
             array_map([$this, 'getTraitLastModificationTime'], $class->getTraits()),
230 230
             array_map([$this, 'getLastModification'], $class->getInterfaces()),
Please login to merge, or discard this patch.
lib/Doctrine/Common/Annotations/FileCacheReader.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function __construct(Reader $reader, $cacheDir, $debug = false, $umask = 0002)
65 65
     {
66
-        if (! is_int($umask)) {
66
+        if (!is_int($umask)) {
67 67
             throw new InvalidArgumentException(sprintf(
68 68
                 'The parameter umask must be an integer, was: %s',
69 69
                 gettype($umask)
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $this->reader = $reader;
74 74
         $this->umask  = $umask;
75 75
 
76
-        if (! is_dir($cacheDir) && ! @mkdir($cacheDir, 0777 & (~$this->umask), true)) {
76
+        if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777 & (~$this->umask), true)) {
77 77
             throw new InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $cacheDir));
78 78
         }
79 79
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function getClassAnnotations(ReflectionClass $class)
88 88
     {
89
-        if (! isset($this->classNameHashes[$class->name])) {
89
+        if (!isset($this->classNameHashes[$class->name])) {
90 90
             $this->classNameHashes[$class->name] = sha1($class->name);
91 91
         }
92 92
 
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
             return $this->loadedAnnotations[$key];
97 97
         }
98 98
 
99
-        $path = $this->dir . '/' . strtr($key, '\\', '-') . '.cache.php';
100
-        if (! is_file($path)) {
99
+        $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
100
+        if (!is_file($path)) {
101 101
             $annot = $this->reader->getClassAnnotations($class);
102 102
             $this->saveCacheFile($path, $annot);
103 103
 
@@ -126,18 +126,18 @@  discard block
 block discarded – undo
126 126
     public function getPropertyAnnotations(ReflectionProperty $property)
127 127
     {
128 128
         $class = $property->getDeclaringClass();
129
-        if (! isset($this->classNameHashes[$class->name])) {
129
+        if (!isset($this->classNameHashes[$class->name])) {
130 130
             $this->classNameHashes[$class->name] = sha1($class->name);
131 131
         }
132 132
 
133
-        $key = $this->classNameHashes[$class->name] . '$' . $property->getName();
133
+        $key = $this->classNameHashes[$class->name].'$'.$property->getName();
134 134
 
135 135
         if (isset($this->loadedAnnotations[$key])) {
136 136
             return $this->loadedAnnotations[$key];
137 137
         }
138 138
 
139
-        $path = $this->dir . '/' . strtr($key, '\\', '-') . '.cache.php';
140
-        if (! is_file($path)) {
139
+        $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
140
+        if (!is_file($path)) {
141 141
             $annot = $this->reader->getPropertyAnnotations($property);
142 142
             $this->saveCacheFile($path, $annot);
143 143
 
@@ -166,18 +166,18 @@  discard block
 block discarded – undo
166 166
     public function getMethodAnnotations(ReflectionMethod $method)
167 167
     {
168 168
         $class = $method->getDeclaringClass();
169
-        if (! isset($this->classNameHashes[$class->name])) {
169
+        if (!isset($this->classNameHashes[$class->name])) {
170 170
             $this->classNameHashes[$class->name] = sha1($class->name);
171 171
         }
172 172
 
173
-        $key = $this->classNameHashes[$class->name] . '#' . $method->getName();
173
+        $key = $this->classNameHashes[$class->name].'#'.$method->getName();
174 174
 
175 175
         if (isset($this->loadedAnnotations[$key])) {
176 176
             return $this->loadedAnnotations[$key];
177 177
         }
178 178
 
179
-        $path = $this->dir . '/' . strtr($key, '\\', '-') . '.cache.php';
180
-        if (! is_file($path)) {
179
+        $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
180
+        if (!is_file($path)) {
181 181
             $annot = $this->reader->getMethodAnnotations($method);
182 182
             $this->saveCacheFile($path, $annot);
183 183
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      */
211 211
     private function saveCacheFile($path, $data)
212 212
     {
213
-        if (! is_writable($this->dir)) {
213
+        if (!is_writable($this->dir)) {
214 214
             throw new InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support this, check out the acl package.', $this->dir));
215 215
         }
216 216
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
         @chmod($tempfile, 0666 & (~$this->umask));
224 224
 
225
-        $written = file_put_contents($tempfile, '<?php return unserialize(' . var_export(serialize($data), true) . ');');
225
+        $written = file_put_contents($tempfile, '<?php return unserialize('.var_export(serialize($data), true).');');
226 226
 
227 227
         if ($written === false) {
228 228
             throw new RuntimeException(sprintf('Unable to write cached file to: %s', $tempfile));
Please login to merge, or discard this patch.
lib/Doctrine/Common/Annotations/TokenParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $statements    = [];
103 103
         $explicitAlias = false;
104 104
         while (($token = $this->next())) {
105
-            if (! $explicitAlias && $token[0] === T_STRING) {
105
+            if (!$explicitAlias && $token[0] === T_STRING) {
106 106
                 $class .= $token[1];
107 107
                 $alias  = $token[1];
108 108
             } elseif ($explicitAlias && $token[0] === T_STRING) {
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
                 $explicitAlias = true;
120 120
                 $alias         = '';
121 121
             } elseif ($token === ',') {
122
-                $statements[strtolower($alias)] = $groupRoot . $class;
122
+                $statements[strtolower($alias)] = $groupRoot.$class;
123 123
                 $class                          = '';
124 124
                 $alias                          = '';
125 125
                 $explicitAlias                  = false;
126 126
             } elseif ($token === ';') {
127
-                $statements[strtolower($alias)] = $groupRoot . $class;
127
+                $statements[strtolower($alias)] = $groupRoot.$class;
128 128
                 break;
129 129
             } elseif ($token === '{') {
130 130
                 $groupRoot = $class;
Please login to merge, or discard this patch.
lib/Doctrine/Common/Annotations/AnnotationReader.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
140 140
         $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces);
141 141
 
142
-        return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName());
142
+        return $this->parser->parse($class->getDocComment(), 'class '.$class->getName());
143 143
     }
144 144
 
145 145
     /**
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     public function getPropertyAnnotations(ReflectionProperty $property)
165 165
     {
166 166
         $class   = $property->getDeclaringClass();
167
-        $context = 'property ' . $class->getName() . '::$' . $property->getName();
167
+        $context = 'property '.$class->getName().'::$'.$property->getName();
168 168
 
169 169
         $this->parser->setTarget(Target::TARGET_PROPERTY);
170 170
         $this->parser->setImports($this->getPropertyImports($property));
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     public function getMethodAnnotations(ReflectionMethod $method)
197 197
     {
198 198
         $class   = $method->getDeclaringClass();
199
-        $context = 'method ' . $class->getName() . '::' . $method->getName() . '()';
199
+        $context = 'method '.$class->getName().'::'.$method->getName().'()';
200 200
 
201 201
         $this->parser->setTarget(Target::TARGET_METHOD);
202 202
         $this->parser->setImports($this->getMethodImports($method));
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 
271 271
         foreach ($class->getTraits() as $trait) {
272 272
             if (
273
-                ! $trait->hasMethod($method->getName())
273
+                !$trait->hasMethod($method->getName())
274 274
                 || $trait->getFileName() !== $method->getFileName()
275 275
             ) {
276 276
                 continue;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         $traitImports = [];
296 296
 
297 297
         foreach ($class->getTraits() as $trait) {
298
-            if (! $trait->hasProperty($property->getName())) {
298
+            if (!$trait->hasProperty($property->getName())) {
299 299
                 continue;
300 300
             }
301 301
 
@@ -311,10 +311,10 @@  discard block
 block discarded – undo
311 311
     private function collectParsingMetadata(ReflectionClass $class)
312 312
     {
313 313
         $ignoredAnnotationNames = self::$globalIgnoredNames;
314
-        $annotations            = $this->preParser->parse($class->getDocComment(), 'class ' . $class->name);
314
+        $annotations            = $this->preParser->parse($class->getDocComment(), 'class '.$class->name);
315 315
 
316 316
         foreach ($annotations as $annotation) {
317
-            if (! ($annotation instanceof IgnoreAnnotation)) {
317
+            if (!($annotation instanceof IgnoreAnnotation)) {
318 318
                 continue;
319 319
             }
320 320
 
Please login to merge, or discard this patch.
lib/Doctrine/Common/Annotations/AnnotationRegistry.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                 continue;
144 144
             }
145 145
 
146
-            $file = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
146
+            $file = str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
147 147
 
148 148
             if ($dirs === null) {
149 149
                 if ($path = stream_resolve_include_path($file)) {
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
                 }
154 154
             } else {
155 155
                 foreach ((array) $dirs as $dir) {
156
-                    if (is_file($dir . DIRECTORY_SEPARATOR . $file)) {
157
-                        require $dir . DIRECTORY_SEPARATOR . $file;
156
+                    if (is_file($dir.DIRECTORY_SEPARATOR.$file)) {
157
+                        require $dir.DIRECTORY_SEPARATOR.$file;
158 158
 
159 159
                         return true;
160 160
                     }
Please login to merge, or discard this patch.