Completed
Pull Request — master (#786)
by Adam
05:12
created
src/Annotation/VirtualProperty.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         }
39 39
 
40 40
         foreach ($data as $key => $value) {
41
-            if (!property_exists(__CLASS__, $key)) {
41
+            if ( ! property_exists(__CLASS__, $key)) {
42 42
                 throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, __CLASS__));
43 43
             }
44 44
             $this->{$key} = $value;
Please login to merge, or discard this patch.
src/Handler/StdClassHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         $classMetadata = $context->getMetadataFactory()->getMetadataForClass('stdClass');
51 51
         $visitor->startVisitingObject($classMetadata, $stdClass, array('name' => 'stdClass'), $context);
52 52
 
53
-        foreach ((array)$stdClass as $name => $value) {
53
+        foreach ((array) $stdClass as $name => $value) {
54 54
             $metadata = new StaticPropertyMetadata('stdClass', $name, $value);
55 55
             $visitor->visitProperty($metadata, $value, $context);
56 56
         }
Please login to merge, or discard this patch.
src/Expression/ExpressionEvaluator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,13 +64,13 @@
 block discarded – undo
64 64
      */
65 65
     public function evaluate($expression, array $data = array())
66 66
     {
67
-        if (!is_string($expression)) {
67
+        if ( ! is_string($expression)) {
68 68
             return $expression;
69 69
         }
70 70
 
71 71
         $context = $data + $this->context;
72 72
 
73
-        if (!array_key_exists($expression, $this->cache)) {
73
+        if ( ! array_key_exists($expression, $this->cache)) {
74 74
             $this->cache[$expression] = $this->expressionLanguage->parse($expression, array_keys($context));
75 75
         }
76 76
 
Please login to merge, or discard this patch.
src/EventDispatcher/Subscriber/SymfonyValidatorValidatorSubscriber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             ? null
57 57
             : $context->attributes->get('validation_groups')->get();
58 58
 
59
-        if (!$groups) {
59
+        if ( ! $groups) {
60 60
             return;
61 61
         }
62 62
 
Please login to merge, or discard this patch.
src/Metadata/Driver/AnnotationDriver.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
 use JMS\Serializer\Annotation\AccessType;
25 25
 use JMS\Serializer\Annotation\Discriminator;
26 26
 use JMS\Serializer\Annotation\Exclude;
27
-use JMS\Serializer\Annotation\ExcludeIf;
28 27
 use JMS\Serializer\Annotation\ExclusionPolicy;
29 28
 use JMS\Serializer\Annotation\Expose;
30 29
 use JMS\Serializer\Annotation\Groups;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
                     $classMetadata->setDiscriminator($annot->field, $annot->map, $annot->groups);
105 105
                 }
106 106
             } elseif ($annot instanceof XmlDiscriminator) {
107
-                $classMetadata->xmlDiscriminatorAttribute = (bool)$annot->attribute;
108
-                $classMetadata->xmlDiscriminatorCData = (bool)$annot->cdata;
109
-                $classMetadata->xmlDiscriminatorNamespace = $annot->namespace ? (string)$annot->namespace : null;
107
+                $classMetadata->xmlDiscriminatorAttribute = (bool) $annot->attribute;
108
+                $classMetadata->xmlDiscriminatorCData = (bool) $annot->cdata;
109
+                $classMetadata->xmlDiscriminatorNamespace = $annot->namespace ? (string) $annot->namespace : null;
110 110
             } elseif ($annot instanceof VirtualProperty) {
111 111
                 $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, $annot->name, $annot->exp);
112 112
                 $propertiesMetadata[] = $virtualPropertyMetadata;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             }
144 144
         }
145 145
 
146
-        if (!$excludeAll) {
146
+        if ( ! $excludeAll) {
147 147
             foreach ($class->getProperties() as $property) {
148 148
                 if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) {
149 149
                     continue;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                     } elseif ($annot instanceof Expose) {
175 175
                         $isExpose = true;
176 176
                         if (null !== $annot->if) {
177
-                            $propertyMetadata->excludeIf = "!(" . $annot->if . ")";
177
+                            $propertyMetadata->excludeIf = "!(".$annot->if.")";
178 178
                         }
179 179
                     } elseif ($annot instanceof Exclude) {
180 180
                         if (null !== $annot->if) {
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
                         $accessor = array($annot->getter, $annot->setter);
219 219
                     } elseif ($annot instanceof Groups) {
220 220
                         $propertyMetadata->groups = $annot->groups;
221
-                        foreach ((array)$propertyMetadata->groups as $groupName) {
221
+                        foreach ((array) $propertyMetadata->groups as $groupName) {
222 222
                             if (false !== strpos($groupName, ',')) {
223 223
                                 throw new InvalidArgumentException(sprintf(
224 224
                                     'Invalid group name "%s" on "%s", did you mean to create multiple groups?',
225 225
                                     implode(', ', $propertyMetadata->groups),
226
-                                    $propertyMetadata->class . '->' . $propertyMetadata->name
226
+                                    $propertyMetadata->class.'->'.$propertyMetadata->name
227 227
                                 ));
228 228
                             }
229 229
                         }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
                 }
238 238
 
239 239
 
240
-                if ((ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude)
240
+                if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude)
241 241
                     || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose)
242 242
                 ) {
243 243
                     $propertyMetadata->setAccessor($accessType, $accessor[0], $accessor[1]);
Please login to merge, or discard this patch.
src/Exclusion/GroupsExclusionStrategy.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     {
53 53
         $groups = $this->getGroupsFor($navigatorContext);
54 54
 
55
-        if (!$property->groups) {
56
-            return !in_array(self::DEFAULT_GROUP, $groups);
55
+        if ( ! $property->groups) {
56
+            return ! in_array(self::DEFAULT_GROUP, $groups);
57 57
         }
58 58
 
59 59
         return $this->shouldSkipUsingGroups($property, $groups);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
         $groups = $this->groups;
78 78
         foreach ($paths as $index => $path) {
79
-            if (!array_key_exists($path, $groups)) {
79
+            if ( ! array_key_exists($path, $groups)) {
80 80
                 if ($index > 0) {
81 81
                     $groups = array(self::DEFAULT_GROUP);
82 82
                 }
Please login to merge, or discard this patch.
src/Exclusion/DisjunctExclusionStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      */
42 42
     public function __construct($delegates)
43 43
     {
44
-        if (!$delegates instanceof SequenceInterface) {
44
+        if ( ! $delegates instanceof SequenceInterface) {
45 45
             $delegates = new Sequence($delegates);
46 46
         }
47 47
 
Please login to merge, or discard this patch.
src/SerializerBuilder.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
     protected function getAccessorStrategy()
112 112
     {
113
-        if (!$this->accessorStrategy) {
113
+        if ( ! $this->accessorStrategy) {
114 114
             $this->accessorStrategy = new DefaultAccessorStrategy();
115 115
 
116 116
             if ($this->expressionEvaluator) {
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
 
135 135
     public function setDebug($bool)
136 136
     {
137
-        $this->debug = (boolean)$bool;
137
+        $this->debug = (boolean) $bool;
138 138
 
139 139
         return $this;
140 140
     }
141 141
 
142 142
     public function setCacheDir($dir)
143 143
     {
144
-        if (!is_dir($dir)) {
144
+        if ( ! is_dir($dir)) {
145 145
             $this->createDir($dir);
146 146
         }
147
-        if (!is_writable($dir)) {
147
+        if ( ! is_writable($dir)) {
148 148
             throw new InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
149 149
         }
150 150
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      */
252 252
     public function includeInterfaceMetadata($include)
253 253
     {
254
-        $this->includeInterfaceMetadata = (Boolean)$include;
254
+        $this->includeInterfaceMetadata = (Boolean) $include;
255 255
 
256 256
         return $this;
257 257
     }
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     public function setMetadataDirs(array $namespacePrefixToDirMap)
271 271
     {
272 272
         foreach ($namespacePrefixToDirMap as $dir) {
273
-            if (!is_dir($dir)) {
273
+            if ( ! is_dir($dir)) {
274 274
                 throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
275 275
             }
276 276
         }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      */
309 309
     public function addMetadataDir($dir, $namespacePrefix = '')
310 310
     {
311
-        if (!is_dir($dir)) {
311
+        if ( ! is_dir($dir)) {
312 312
             throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
313 313
         }
314 314
 
@@ -350,11 +350,11 @@  discard block
 block discarded – undo
350 350
      */
351 351
     public function replaceMetadataDir($dir, $namespacePrefix = '')
352 352
     {
353
-        if (!is_dir($dir)) {
353
+        if ( ! is_dir($dir)) {
354 354
             throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
355 355
         }
356 356
 
357
-        if (!isset($this->metadataDirs[$namespacePrefix])) {
357
+        if ( ! isset($this->metadataDirs[$namespacePrefix])) {
358 358
             throw new InvalidArgumentException(sprintf('There is no directory configured for namespace prefix "%s". Please use addMetadataDir() for adding new directories.', $namespacePrefix));
359 359
         }
360 360
 
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
             $annotationReader = new AnnotationReader();
418 418
 
419 419
             if (null !== $this->cacheDir) {
420
-                $this->createDir($this->cacheDir . '/annotations');
421
-                $annotationsCache = new FilesystemCache($this->cacheDir . '/annotations');
420
+                $this->createDir($this->cacheDir.'/annotations');
421
+                $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations');
422 422
                 $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug);
423 423
             }
424 424
         }
@@ -429,19 +429,19 @@  discard block
 block discarded – undo
429 429
         $metadataFactory->setIncludeInterfaces($this->includeInterfaceMetadata);
430 430
 
431 431
         if (null !== $this->cacheDir) {
432
-            $this->createDir($this->cacheDir . '/metadata');
433
-            $metadataFactory->setCache(new FileCache($this->cacheDir . '/metadata'));
432
+            $this->createDir($this->cacheDir.'/metadata');
433
+            $metadataFactory->setCache(new FileCache($this->cacheDir.'/metadata'));
434 434
         }
435 435
 
436
-        if (!$this->handlersConfigured) {
436
+        if ( ! $this->handlersConfigured) {
437 437
             $this->addDefaultHandlers();
438 438
         }
439 439
 
440
-        if (!$this->listenersConfigured) {
440
+        if ( ! $this->listenersConfigured) {
441 441
             $this->addDefaultListeners();
442 442
         }
443 443
 
444
-        if (!$this->visitorsAdded) {
444
+        if ( ! $this->visitorsAdded) {
445 445
             $this->addDefaultSerializationVisitors();
446 446
             $this->addDefaultDeserializationVisitors();
447 447
         }
Please login to merge, or discard this patch.
src/Annotation/ExclusionPolicy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 
34 34
     public function __construct(array $values)
35 35
     {
36
-        if (!is_string($values['value'])) {
36
+        if ( ! is_string($values['value'])) {
37 37
             throw new RuntimeException('"value" must be a string.');
38 38
         }
39 39
 
Please login to merge, or discard this patch.