Passed
Pull Request — master (#900)
by Michael
03:15
created
src/EventDispatcher/Subscriber/DoctrineProxySubscriber.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function __construct($skipVirtualTypeInit = true, $initializeExcluded = false)
43 43
     {
44
-        $this->skipVirtualTypeInit = (bool)$skipVirtualTypeInit;
45
-        $this->initializeExcluded = (bool)$initializeExcluded;
44
+        $this->skipVirtualTypeInit = (bool) $skipVirtualTypeInit;
45
+        $this->initializeExcluded = (bool) $initializeExcluded;
46 46
     }
47 47
 
48 48
     public function onPreSerialize(PreSerializeEvent $event)
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
         // If the set type name is not an actual class, but a faked type for which a custom handler exists, we do not
54 54
         // modify it with this subscriber. Also, we forgo autoloading here as an instance of this type is already created,
55 55
         // so it must be loaded if its a real class.
56
-        $virtualType = !class_exists($type['name'], false);
56
+        $virtualType = ! class_exists($type['name'], false);
57 57
 
58 58
         if ($object instanceof PersistentCollection
59 59
             || $object instanceof MongoDBPersistentCollection
60 60
             || $object instanceof PHPCRPersistentCollection
61 61
         ) {
62
-            if (!$virtualType) {
62
+            if ( ! $virtualType) {
63 63
                 $event->setType('ArrayCollection');
64 64
             }
65 65
 
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
         }
68 68
 
69 69
         if (($this->skipVirtualTypeInit && $virtualType) ||
70
-            (!$object instanceof Proxy && !$object instanceof ORMProxy)
70
+            ( ! $object instanceof Proxy && ! $object instanceof ORMProxy)
71 71
         ) {
72 72
             return;
73 73
         }
74 74
 
75 75
         // do not initialize the proxy if is going to be excluded by-class by some exclusion strategy
76
-        if ($this->initializeExcluded === false && !$virtualType) {
76
+        if ($this->initializeExcluded === false && ! $virtualType) {
77 77
             $context = $event->getContext();
78 78
             $exclusionStrategy = $context->getExclusionStrategy();
79 79
             $metadata = $context->getMetadataFactory()->getMetadataForClass(get_parent_class($object));
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
         $object->__load();
86 86
 
87
-        if (!$virtualType) {
87
+        if ( ! $virtualType) {
88 88
             $event->setType(get_parent_class($object), $type['params']);
89 89
         }
90 90
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     {
94 94
         $type = $event->getType();
95 95
         // is a virtual type? then there is no need to change the event name
96
-        if (!class_exists($type['name'], false)) {
96
+        if ( ! class_exists($type['name'], false)) {
97 97
             return;
98 98
         }
99 99
 
Please login to merge, or discard this patch.
src/Metadata/Driver/AnnotationDriver.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
                     $classMetadata->setDiscriminator($annot->field, $annot->map, $annot->groups);
113 113
                 }
114 114
             } elseif ($annot instanceof XmlDiscriminator) {
115
-                $classMetadata->xmlDiscriminatorAttribute = (bool)$annot->attribute;
116
-                $classMetadata->xmlDiscriminatorCData = (bool)$annot->cdata;
117
-                $classMetadata->xmlDiscriminatorNamespace = $annot->namespace ? (string)$annot->namespace : null;
115
+                $classMetadata->xmlDiscriminatorAttribute = (bool) $annot->attribute;
116
+                $classMetadata->xmlDiscriminatorCData = (bool) $annot->cdata;
117
+                $classMetadata->xmlDiscriminatorNamespace = $annot->namespace ? (string) $annot->namespace : null;
118 118
             } elseif ($annot instanceof VirtualProperty) {
119 119
                 $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, $annot->name, $annot->exp);
120 120
                 $propertiesMetadata[] = $virtualPropertyMetadata;
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             }
149 149
         }
150 150
 
151
-        if (!$excludeAll) {
151
+        if ( ! $excludeAll) {
152 152
             foreach ($class->getProperties() as $property) {
153 153
                 if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) {
154 154
                     continue;
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                     } elseif ($annot instanceof Expose) {
180 180
                         $isExpose = true;
181 181
                         if (null !== $annot->if) {
182
-                            $propertyMetadata->excludeIf = "!(" . $annot->if . ")";
182
+                            $propertyMetadata->excludeIf = "!(".$annot->if.")";
183 183
                         }
184 184
                     } elseif ($annot instanceof Exclude) {
185 185
                         if (null !== $annot->if) {
@@ -223,12 +223,12 @@  discard block
 block discarded – undo
223 223
                         $accessor = array($annot->getter, $annot->setter);
224 224
                     } elseif ($annot instanceof Groups) {
225 225
                         $propertyMetadata->groups = $annot->groups;
226
-                        foreach ((array)$propertyMetadata->groups as $groupName) {
226
+                        foreach ((array) $propertyMetadata->groups as $groupName) {
227 227
                             if (false !== strpos($groupName, ',')) {
228 228
                                 throw new InvalidArgumentException(sprintf(
229 229
                                     'Invalid group name "%s" on "%s", did you mean to create multiple groups?',
230 230
                                     implode(', ', $propertyMetadata->groups),
231
-                                    $propertyMetadata->class . '->' . $propertyMetadata->name
231
+                                    $propertyMetadata->class.'->'.$propertyMetadata->name
232 232
                                 ));
233 233
                             }
234 234
                         }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
                     }
242 242
                 }
243 243
 
244
-                if (!$propertyMetadata->serializedName) {
244
+                if ( ! $propertyMetadata->serializedName) {
245 245
                     $propertyMetadata->serializedName = $this->namingStrategy->translateName($propertyMetadata);
246 246
                 }
247 247
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                     }
252 252
                 }
253 253
 
254
-                if ((ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude)
254
+                if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude)
255 255
                     || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose)
256 256
                 ) {
257 257
                     $propertyMetadata->setAccessor($accessType, $accessor[0], $accessor[1]);
Please login to merge, or discard this patch.
src/SerializationContext.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
     public function startVisiting($object): void
54 54
     {
55
-        if (!\is_object($object)) {
55
+        if ( ! \is_object($object)) {
56 56
             return;
57 57
         }
58 58
         $this->visitingSet->attach($object);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function stopVisiting($object): void
63 63
     {
64
-        if (!\is_object($object)) {
64
+        if ( ! \is_object($object)) {
65 65
             return;
66 66
         }
67 67
         $this->visitingSet->detach($object);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
     public function isVisiting($object): bool
76 76
     {
77
-        if (!\is_object($object)) {
77
+        if ( ! \is_object($object)) {
78 78
             return false;
79 79
         }
80 80
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             $path[] = \get_class($obj);
89 89
         }
90 90
 
91
-        if (!$path) {
91
+        if ( ! $path) {
92 92
             return null;
93 93
         }
94 94
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
     public function getObject()
109 109
     {
110
-        return !$this->visitingStack->isEmpty() ? $this->visitingStack->top() : null;
110
+        return ! $this->visitingStack->isEmpty() ? $this->visitingStack->top() : null;
111 111
     }
112 112
 
113 113
     public function getVisitingStack()
Please login to merge, or discard this patch.
src/Naming/CamelCaseNamingStrategy.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 translateName(PropertyMetadata $property):string
43 43
     {
44
-        $name = preg_replace('/[A-Z]+/', $this->separator . '\\0', $property->name);
44
+        $name = preg_replace('/[A-Z]+/', $this->separator.'\\0', $property->name);
45 45
 
46 46
         if ($this->lowerCase) {
47 47
             return strtolower($name);
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);
56 56
         }
Please login to merge, or discard this patch.
src/Handler/HandlerRegistry.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
 
36 36
         switch ($direction) {
37 37
             case GraphNavigatorInterface::DIRECTION_DESERIALIZATION:
38
-                return 'deserialize' . $type . 'From' . $format;
38
+                return 'deserialize'.$type.'From'.$format;
39 39
 
40 40
             case GraphNavigatorInterface::DIRECTION_SERIALIZATION:
41
-                return 'serialize' . $type . 'To' . $format;
41
+                return 'serialize'.$type.'To'.$format;
42 42
 
43 43
             default:
44 44
                 throw new LogicException(sprintf('The direction %s does not exist; see GraphNavigatorInterface::DIRECTION_??? constants.', json_encode($direction)));
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     public function registerSubscribingHandler(SubscribingHandlerInterface $handler):void
54 54
     {
55 55
         foreach ($handler->getSubscribingMethods() as $methodData) {
56
-            if (!isset($methodData['type'], $methodData['format'])) {
56
+            if ( ! isset($methodData['type'], $methodData['format'])) {
57 57
                 throw new RuntimeException(sprintf('For each subscribing method a "type" and "format" attribute must be given, but only got "%s" for %s.', implode('" and "', array_keys($methodData)), \get_class($handler)));
58 58
             }
59 59
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
     public function getHandler(int $direction, string $typeName, string $format)
82 82
     {
83
-        if (!isset($this->handlers[$direction][$typeName][$format])) {
83
+        if ( ! isset($this->handlers[$direction][$typeName][$format])) {
84 84
             return null;
85 85
         }
86 86
 
Please login to merge, or discard this patch.
src/JsonSerializationVisitor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         $rs = isset($type['params'][1]) ? new \ArrayObject() : array();
87 87
 
88
-        $isList = isset($type['params'][0]) && !isset($type['params'][1]);
88
+        $isList = isset($type['params'][0]) && ! isset($type['params'][1]);
89 89
 
90 90
         $elType = $this->getElementType($type);
91 91
         foreach ($data as $k => $v) {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         if ($metadata->inline) {
152 152
             if (\is_array($v) || ($v instanceof \ArrayObject)) {
153
-                $this->data = array_merge($this->data, (array)$v);
153
+                $this->data = array_merge($this->data, (array) $v);
154 154
             }
155 155
         } else {
156 156
             $this->data[$metadata->serializedName] = $v;
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
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
     private function getAccessorStrategy()
117 117
     {
118
-        if (!$this->accessorStrategy) {
118
+        if ( ! $this->accessorStrategy) {
119 119
             $this->accessorStrategy = new DefaultAccessorStrategy();
120 120
 
121 121
             if ($this->expressionEvaluator) {
@@ -148,17 +148,17 @@  discard block
 block discarded – undo
148 148
 
149 149
     public function setDebug($bool)
150 150
     {
151
-        $this->debug = (boolean)$bool;
151
+        $this->debug = (boolean) $bool;
152 152
 
153 153
         return $this;
154 154
     }
155 155
 
156 156
     public function setCacheDir($dir)
157 157
     {
158
-        if (!is_dir($dir)) {
158
+        if ( ! is_dir($dir)) {
159 159
             $this->createDir($dir);
160 160
         }
161
-        if (!is_writable($dir)) {
161
+        if ( ! is_writable($dir)) {
162 162
             throw new InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
163 163
         }
164 164
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
      */
261 261
     public function includeInterfaceMetadata($include)
262 262
     {
263
-        $this->includeInterfaceMetadata = (Boolean)$include;
263
+        $this->includeInterfaceMetadata = (Boolean) $include;
264 264
 
265 265
         return $this;
266 266
     }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     public function setMetadataDirs(array $namespacePrefixToDirMap)
280 280
     {
281 281
         foreach ($namespacePrefixToDirMap as $dir) {
282
-            if (!is_dir($dir)) {
282
+            if ( ! is_dir($dir)) {
283 283
                 throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
284 284
             }
285 285
         }
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
      */
318 318
     public function addMetadataDir($dir, $namespacePrefix = '')
319 319
     {
320
-        if (!is_dir($dir)) {
320
+        if ( ! is_dir($dir)) {
321 321
             throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
322 322
         }
323 323
 
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
      */
360 360
     public function replaceMetadataDir($dir, $namespacePrefix = '')
361 361
     {
362
-        if (!is_dir($dir)) {
362
+        if ( ! is_dir($dir)) {
363 363
             throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
364 364
         }
365 365
 
366
-        if (!isset($this->metadataDirs[$namespacePrefix])) {
366
+        if ( ! isset($this->metadataDirs[$namespacePrefix])) {
367 367
             throw new InvalidArgumentException(sprintf('There is no directory configured for namespace prefix "%s". Please use addMetadataDir() for adding new directories.', $namespacePrefix));
368 368
         }
369 369
 
@@ -426,8 +426,8 @@  discard block
 block discarded – undo
426 426
             $annotationReader = new AnnotationReader();
427 427
 
428 428
             if (null !== $this->cacheDir) {
429
-                $this->createDir($this->cacheDir . '/annotations');
430
-                $annotationsCache = new FilesystemCache($this->cacheDir . '/annotations');
429
+                $this->createDir($this->cacheDir.'/annotations');
430
+                $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations');
431 431
                 $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug);
432 432
             }
433 433
         }
@@ -443,19 +443,19 @@  discard block
 block discarded – undo
443 443
         $metadataFactory->setIncludeInterfaces($this->includeInterfaceMetadata);
444 444
 
445 445
         if (null !== $this->cacheDir) {
446
-            $this->createDir($this->cacheDir . '/metadata');
447
-            $metadataFactory->setCache(new FileCache($this->cacheDir . '/metadata'));
446
+            $this->createDir($this->cacheDir.'/metadata');
447
+            $metadataFactory->setCache(new FileCache($this->cacheDir.'/metadata'));
448 448
         }
449 449
 
450
-        if (!$this->handlersConfigured) {
450
+        if ( ! $this->handlersConfigured) {
451 451
             $this->addDefaultHandlers();
452 452
         }
453 453
 
454
-        if (!$this->listenersConfigured) {
454
+        if ( ! $this->listenersConfigured) {
455 455
             $this->addDefaultListeners();
456 456
         }
457 457
 
458
-        if (!$this->visitorsAdded) {
458
+        if ( ! $this->visitorsAdded) {
459 459
             $this->addDefaultSerializationVisitors();
460 460
             $this->addDefaultDeserializationVisitors();
461 461
         }
Please login to merge, or discard this patch.
src/Metadata/Driver/XmlDriver.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     private $namingStrategy;
44 44
 
45
-    public function __construct(FileLocatorInterface $locator, PropertyNamingStrategyInterface $namingStrategy,  ParserInterface $typeParser = null)
45
+    public function __construct(FileLocatorInterface $locator, PropertyNamingStrategyInterface $namingStrategy, ParserInterface $typeParser = null)
46 46
     {
47 47
         parent::__construct($locator);
48 48
         $this->typeParser = $typeParser ?: new Parser();
@@ -62,97 +62,97 @@  discard block
 block discarded – undo
62 62
         }
63 63
 
64 64
         $metadata = new ClassMetadata($name = $class->name);
65
-        if (!$elems = $elem->xpath("./class[@name = '" . $name . "']")) {
65
+        if ( ! $elems = $elem->xpath("./class[@name = '".$name."']")) {
66 66
             throw new RuntimeException(sprintf('Could not find class %s inside XML element.', $name));
67 67
         }
68 68
         $elem = reset($elems);
69 69
 
70 70
         $metadata->fileResources[] = $path;
71 71
         $metadata->fileResources[] = $class->getFileName();
72
-        $exclusionPolicy = strtoupper((string)$elem->attributes()->{'exclusion-policy'}) ?: 'NONE';
73
-        $excludeAll = null !== ($exclude = $elem->attributes()->exclude) ? 'true' === strtolower((string)$exclude) : false;
74
-        $classAccessType = (string)($elem->attributes()->{'access-type'} ?: PropertyMetadata::ACCESS_TYPE_PROPERTY);
72
+        $exclusionPolicy = strtoupper((string) $elem->attributes()->{'exclusion-policy'}) ?: 'NONE';
73
+        $excludeAll = null !== ($exclude = $elem->attributes()->exclude) ? 'true' === strtolower((string) $exclude) : false;
74
+        $classAccessType = (string) ($elem->attributes()->{'access-type'} ?: PropertyMetadata::ACCESS_TYPE_PROPERTY);
75 75
 
76 76
         $propertiesMetadata = array();
77 77
         $propertiesNodes = array();
78 78
 
79 79
         if (null !== $accessorOrder = $elem->attributes()->{'accessor-order'}) {
80
-            $metadata->setAccessorOrder((string)$accessorOrder, preg_split('/\s*,\s*/', (string)$elem->attributes()->{'custom-accessor-order'}));
80
+            $metadata->setAccessorOrder((string) $accessorOrder, preg_split('/\s*,\s*/', (string) $elem->attributes()->{'custom-accessor-order'}));
81 81
         }
82 82
 
83 83
         if (null !== $xmlRootName = $elem->attributes()->{'xml-root-name'}) {
84
-            $metadata->xmlRootName = (string)$xmlRootName;
84
+            $metadata->xmlRootName = (string) $xmlRootName;
85 85
         }
86 86
 
87 87
         if (null !== $xmlRootNamespace = $elem->attributes()->{'xml-root-namespace'}) {
88
-            $metadata->xmlRootNamespace = (string)$xmlRootNamespace;
88
+            $metadata->xmlRootNamespace = (string) $xmlRootNamespace;
89 89
         }
90 90
 
91
-        $readOnlyClass = 'true' === strtolower((string)$elem->attributes()->{'read-only'});
91
+        $readOnlyClass = 'true' === strtolower((string) $elem->attributes()->{'read-only'});
92 92
 
93
-        $discriminatorFieldName = (string)$elem->attributes()->{'discriminator-field-name'};
93
+        $discriminatorFieldName = (string) $elem->attributes()->{'discriminator-field-name'};
94 94
         $discriminatorMap = array();
95 95
         foreach ($elem->xpath('./discriminator-class') as $entry) {
96
-            if (!isset($entry->attributes()->value)) {
96
+            if ( ! isset($entry->attributes()->value)) {
97 97
                 throw new RuntimeException('Each discriminator-class element must have a "value" attribute.');
98 98
             }
99 99
 
100
-            $discriminatorMap[(string)$entry->attributes()->value] = (string)$entry;
100
+            $discriminatorMap[(string) $entry->attributes()->value] = (string) $entry;
101 101
         }
102 102
 
103
-        if ('true' === (string)$elem->attributes()->{'discriminator-disabled'}) {
103
+        if ('true' === (string) $elem->attributes()->{'discriminator-disabled'}) {
104 104
             $metadata->discriminatorDisabled = true;
105
-        } elseif (!empty($discriminatorFieldName) || !empty($discriminatorMap)) {
105
+        } elseif ( ! empty($discriminatorFieldName) || ! empty($discriminatorMap)) {
106 106
 
107 107
             $discriminatorGroups = array();
108 108
             foreach ($elem->xpath('./discriminator-groups/group') as $entry) {
109
-                $discriminatorGroups[] = (string)$entry;
109
+                $discriminatorGroups[] = (string) $entry;
110 110
             }
111 111
             $metadata->setDiscriminator($discriminatorFieldName, $discriminatorMap, $discriminatorGroups);
112 112
         }
113 113
 
114 114
         foreach ($elem->xpath('./xml-namespace') as $xmlNamespace) {
115
-            if (!isset($xmlNamespace->attributes()->uri)) {
115
+            if ( ! isset($xmlNamespace->attributes()->uri)) {
116 116
                 throw new RuntimeException('The prefix attribute must be set for all xml-namespace elements.');
117 117
             }
118 118
 
119 119
             if (isset($xmlNamespace->attributes()->prefix)) {
120
-                $prefix = (string)$xmlNamespace->attributes()->prefix;
120
+                $prefix = (string) $xmlNamespace->attributes()->prefix;
121 121
             } else {
122 122
                 $prefix = null;
123 123
             }
124 124
 
125
-            $metadata->registerNamespace((string)$xmlNamespace->attributes()->uri, $prefix);
125
+            $metadata->registerNamespace((string) $xmlNamespace->attributes()->uri, $prefix);
126 126
         }
127 127
 
128 128
         foreach ($elem->xpath('./xml-discriminator') as $xmlDiscriminator) {
129 129
             if (isset($xmlDiscriminator->attributes()->attribute)) {
130
-                $metadata->xmlDiscriminatorAttribute = (string)$xmlDiscriminator->attributes()->attribute === 'true';
130
+                $metadata->xmlDiscriminatorAttribute = (string) $xmlDiscriminator->attributes()->attribute === 'true';
131 131
             }
132 132
             if (isset($xmlDiscriminator->attributes()->cdata)) {
133
-                $metadata->xmlDiscriminatorCData = (string)$xmlDiscriminator->attributes()->cdata === 'true';
133
+                $metadata->xmlDiscriminatorCData = (string) $xmlDiscriminator->attributes()->cdata === 'true';
134 134
             }
135 135
             if (isset($xmlDiscriminator->attributes()->namespace)) {
136
-                $metadata->xmlDiscriminatorNamespace = (string)$xmlDiscriminator->attributes()->namespace;
136
+                $metadata->xmlDiscriminatorNamespace = (string) $xmlDiscriminator->attributes()->namespace;
137 137
             }
138 138
         }
139 139
 
140 140
         foreach ($elem->xpath('./virtual-property') as $method) {
141 141
 
142 142
             if (isset($method->attributes()->expression)) {
143
-                $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, (string)$method->attributes()->name, (string)$method->attributes()->expression);
143
+                $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, (string) $method->attributes()->name, (string) $method->attributes()->expression);
144 144
             } else {
145
-                if (!isset($method->attributes()->method)) {
145
+                if ( ! isset($method->attributes()->method)) {
146 146
                     throw new RuntimeException('The method attribute must be set for all virtual-property elements.');
147 147
                 }
148
-                $virtualPropertyMetadata = new VirtualPropertyMetadata($name, (string)$method->attributes()->method);
148
+                $virtualPropertyMetadata = new VirtualPropertyMetadata($name, (string) $method->attributes()->method);
149 149
             }
150 150
 
151 151
             $propertiesMetadata[] = $virtualPropertyMetadata;
152 152
             $propertiesNodes[] = $method;
153 153
         }
154 154
 
155
-        if (!$excludeAll) {
155
+        if ( ! $excludeAll) {
156 156
 
157 157
             foreach ($class->getProperties() as $property) {
158 158
                 if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                 }
161 161
 
162 162
                 $propertiesMetadata[] = new PropertyMetadata($name, $pName = $property->getName());
163
-                $pElems = $elem->xpath("./property[@name = '" . $pName . "']");
163
+                $pElems = $elem->xpath("./property[@name = '".$pName."']");
164 164
 
165 165
                 $propertiesNodes[] = $pElems ? reset($pElems) : null;
166 166
             }
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
                     || $pMetadata instanceof ExpressionPropertyMetadata;
173 173
 
174 174
                 $pElem = $propertiesNodes[$propertyKey];
175
-                if (!empty($pElem)) {
175
+                if ( ! empty($pElem)) {
176 176
 
177 177
                     if (null !== $exclude = $pElem->attributes()->exclude) {
178
-                        $isExclude = 'true' === strtolower((string)$exclude);
178
+                        $isExclude = 'true' === strtolower((string) $exclude);
179 179
                     }
180 180
 
181 181
                     if ($isExclude) {
@@ -183,42 +183,42 @@  discard block
 block discarded – undo
183 183
                     }
184 184
 
185 185
                     if (null !== $expose = $pElem->attributes()->expose) {
186
-                        $isExpose = 'true' === strtolower((string)$expose);
186
+                        $isExpose = 'true' === strtolower((string) $expose);
187 187
                     }
188 188
 
189 189
                     if (null !== $excludeIf = $pElem->attributes()->{'exclude-if'}) {
190
-                        $pMetadata->excludeIf = (string)$excludeIf;
190
+                        $pMetadata->excludeIf = (string) $excludeIf;
191 191
                     }
192 192
 
193 193
                     if (null !== $skip = $pElem->attributes()->{'skip-when-empty'}) {
194
-                        $pMetadata->skipWhenEmpty = 'true' === strtolower((string)$skip);
194
+                        $pMetadata->skipWhenEmpty = 'true' === strtolower((string) $skip);
195 195
                     }
196 196
 
197 197
                     if (null !== $excludeIf = $pElem->attributes()->{'expose-if'}) {
198
-                        $pMetadata->excludeIf = "!(" . (string)$excludeIf . ")";
198
+                        $pMetadata->excludeIf = "!(".(string) $excludeIf.")";
199 199
                         $isExpose = true;
200 200
                     }
201 201
 
202 202
                     if (null !== $version = $pElem->attributes()->{'since-version'}) {
203
-                        $pMetadata->sinceVersion = (string)$version;
203
+                        $pMetadata->sinceVersion = (string) $version;
204 204
                     }
205 205
 
206 206
                     if (null !== $version = $pElem->attributes()->{'until-version'}) {
207
-                        $pMetadata->untilVersion = (string)$version;
207
+                        $pMetadata->untilVersion = (string) $version;
208 208
                     }
209 209
 
210 210
                     if (null !== $serializedName = $pElem->attributes()->{'serialized-name'}) {
211
-                        $pMetadata->serializedName = (string)$serializedName;
211
+                        $pMetadata->serializedName = (string) $serializedName;
212 212
                     }
213 213
 
214 214
                     if (null !== $type = $pElem->attributes()->type) {
215
-                        $pMetadata->setType($this->typeParser->parse((string)$type));
215
+                        $pMetadata->setType($this->typeParser->parse((string) $type));
216 216
                     } elseif (isset($pElem->type)) {
217
-                        $pMetadata->setType($this->typeParser->parse((string)$pElem->type));
217
+                        $pMetadata->setType($this->typeParser->parse((string) $pElem->type));
218 218
                     }
219 219
 
220 220
                     if (null !== $groups = $pElem->attributes()->groups) {
221
-                        $pMetadata->groups = preg_split('/\s*,\s*/', trim((string)$groups));
221
+                        $pMetadata->groups = preg_split('/\s*,\s*/', trim((string) $groups));
222 222
                     } elseif (isset($pElem->groups)) {
223 223
                         $pMetadata->groups = (array) $pElem->groups->value;
224 224
                     }
@@ -229,21 +229,21 @@  discard block
 block discarded – undo
229 229
 
230 230
                         $colConfig = $pElem->{'xml-list'};
231 231
                         if (isset($colConfig->attributes()->inline)) {
232
-                            $pMetadata->xmlCollectionInline = 'true' === (string)$colConfig->attributes()->inline;
232
+                            $pMetadata->xmlCollectionInline = 'true' === (string) $colConfig->attributes()->inline;
233 233
                         }
234 234
 
235 235
                         if (isset($colConfig->attributes()->{'entry-name'})) {
236
-                            $pMetadata->xmlEntryName = (string)$colConfig->attributes()->{'entry-name'};
236
+                            $pMetadata->xmlEntryName = (string) $colConfig->attributes()->{'entry-name'};
237 237
                         }
238 238
 
239 239
                         if (isset($colConfig->attributes()->{'skip-when-empty'})) {
240
-                            $pMetadata->xmlCollectionSkipWhenEmpty = 'true' === (string)$colConfig->attributes()->{'skip-when-empty'};
240
+                            $pMetadata->xmlCollectionSkipWhenEmpty = 'true' === (string) $colConfig->attributes()->{'skip-when-empty'};
241 241
                         } else {
242 242
                             $pMetadata->xmlCollectionSkipWhenEmpty = true;
243 243
                         }
244 244
 
245 245
                         if (isset($colConfig->attributes()->namespace)) {
246
-                            $pMetadata->xmlEntryNamespace = (string)$colConfig->attributes()->namespace;
246
+                            $pMetadata->xmlEntryNamespace = (string) $colConfig->attributes()->namespace;
247 247
                         }
248 248
                     }
249 249
 
@@ -252,56 +252,56 @@  discard block
 block discarded – undo
252 252
 
253 253
                         $colConfig = $pElem->{'xml-map'};
254 254
                         if (isset($colConfig->attributes()->inline)) {
255
-                            $pMetadata->xmlCollectionInline = 'true' === (string)$colConfig->attributes()->inline;
255
+                            $pMetadata->xmlCollectionInline = 'true' === (string) $colConfig->attributes()->inline;
256 256
                         }
257 257
 
258 258
                         if (isset($colConfig->attributes()->{'entry-name'})) {
259
-                            $pMetadata->xmlEntryName = (string)$colConfig->attributes()->{'entry-name'};
259
+                            $pMetadata->xmlEntryName = (string) $colConfig->attributes()->{'entry-name'};
260 260
                         }
261 261
 
262 262
                         if (isset($colConfig->attributes()->namespace)) {
263
-                            $pMetadata->xmlEntryNamespace = (string)$colConfig->attributes()->namespace;
263
+                            $pMetadata->xmlEntryNamespace = (string) $colConfig->attributes()->namespace;
264 264
                         }
265 265
 
266 266
                         if (isset($colConfig->attributes()->{'key-attribute-name'})) {
267
-                            $pMetadata->xmlKeyAttribute = (string)$colConfig->attributes()->{'key-attribute-name'};
267
+                            $pMetadata->xmlKeyAttribute = (string) $colConfig->attributes()->{'key-attribute-name'};
268 268
                         }
269 269
                     }
270 270
 
271 271
                     if (isset($pElem->{'xml-element'})) {
272 272
                         $colConfig = $pElem->{'xml-element'};
273 273
                         if (isset($colConfig->attributes()->cdata)) {
274
-                            $pMetadata->xmlElementCData = 'true' === (string)$colConfig->attributes()->cdata;
274
+                            $pMetadata->xmlElementCData = 'true' === (string) $colConfig->attributes()->cdata;
275 275
                         }
276 276
 
277 277
                         if (isset($colConfig->attributes()->namespace)) {
278
-                            $pMetadata->xmlNamespace = (string)$colConfig->attributes()->namespace;
278
+                            $pMetadata->xmlNamespace = (string) $colConfig->attributes()->namespace;
279 279
                         }
280 280
                     }
281 281
 
282 282
                     if (isset($pElem->attributes()->{'xml-attribute'})) {
283
-                        $pMetadata->xmlAttribute = 'true' === (string)$pElem->attributes()->{'xml-attribute'};
283
+                        $pMetadata->xmlAttribute = 'true' === (string) $pElem->attributes()->{'xml-attribute'};
284 284
                     }
285 285
 
286 286
                     if (isset($pElem->attributes()->{'xml-attribute-map'})) {
287
-                        $pMetadata->xmlAttributeMap = 'true' === (string)$pElem->attributes()->{'xml-attribute-map'};
287
+                        $pMetadata->xmlAttributeMap = 'true' === (string) $pElem->attributes()->{'xml-attribute-map'};
288 288
                     }
289 289
 
290 290
                     if (isset($pElem->attributes()->{'xml-value'})) {
291
-                        $pMetadata->xmlValue = 'true' === (string)$pElem->attributes()->{'xml-value'};
291
+                        $pMetadata->xmlValue = 'true' === (string) $pElem->attributes()->{'xml-value'};
292 292
                     }
293 293
 
294 294
                     if (isset($pElem->attributes()->{'xml-key-value-pairs'})) {
295
-                        $pMetadata->xmlKeyValuePairs = 'true' === (string)$pElem->attributes()->{'xml-key-value-pairs'};
295
+                        $pMetadata->xmlKeyValuePairs = 'true' === (string) $pElem->attributes()->{'xml-key-value-pairs'};
296 296
                     }
297 297
 
298 298
                     if (isset($pElem->attributes()->{'max-depth'})) {
299
-                        $pMetadata->maxDepth = (int)$pElem->attributes()->{'max-depth'};
299
+                        $pMetadata->maxDepth = (int) $pElem->attributes()->{'max-depth'};
300 300
                     }
301 301
 
302 302
                     //we need read-only before setter and getter set, because that method depends on flag being set
303 303
                     if (null !== $readOnly = $pElem->attributes()->{'read-only'}) {
304
-                        $pMetadata->readOnly = 'true' === strtolower((string)$readOnly);
304
+                        $pMetadata->readOnly = 'true' === strtolower((string) $readOnly);
305 305
                     } else {
306 306
                         $pMetadata->readOnly = $pMetadata->readOnly || $readOnlyClass;
307 307
                     }
@@ -309,26 +309,26 @@  discard block
 block discarded – undo
309 309
                     $getter = $pElem->attributes()->{'accessor-getter'};
310 310
                     $setter = $pElem->attributes()->{'accessor-setter'};
311 311
                     $pMetadata->setAccessor(
312
-                        (string)($pElem->attributes()->{'access-type'} ?: $classAccessType),
313
-                        $getter ? (string)$getter : null,
314
-                        $setter ? (string)$setter : null
312
+                        (string) ($pElem->attributes()->{'access-type'} ?: $classAccessType),
313
+                        $getter ? (string) $getter : null,
314
+                        $setter ? (string) $setter : null
315 315
                     );
316 316
 
317 317
                     if (null !== $inline = $pElem->attributes()->inline) {
318
-                        $pMetadata->inline = 'true' === strtolower((string)$inline);
318
+                        $pMetadata->inline = 'true' === strtolower((string) $inline);
319 319
                     }
320 320
                 }
321 321
 
322
-                if (!$pMetadata->serializedName) {
322
+                if ( ! $pMetadata->serializedName) {
323 323
                     $pMetadata->serializedName = $this->namingStrategy->translateName($pMetadata);
324 324
                 }
325 325
 
326
-                if (!empty($pElem) && null !== $name = $pElem->attributes()->name) {
327
-                    $pMetadata->name = (string)$name;
326
+                if ( ! empty($pElem) && null !== $name = $pElem->attributes()->name) {
327
+                    $pMetadata->name = (string) $name;
328 328
                 }
329 329
 
330
-                if ((ExclusionPolicy::NONE === (string)$exclusionPolicy && !$isExclude)
331
-                    || (ExclusionPolicy::ALL === (string)$exclusionPolicy && $isExpose)
330
+                if ((ExclusionPolicy::NONE === (string) $exclusionPolicy && ! $isExclude)
331
+                    || (ExclusionPolicy::ALL === (string) $exclusionPolicy && $isExpose)
332 332
                 ) {
333 333
 
334 334
 
@@ -338,31 +338,31 @@  discard block
 block discarded – undo
338 338
         }
339 339
 
340 340
         foreach ($elem->xpath('./callback-method') as $method) {
341
-            if (!isset($method->attributes()->type)) {
341
+            if ( ! isset($method->attributes()->type)) {
342 342
                 throw new RuntimeException('The type attribute must be set for all callback-method elements.');
343 343
             }
344
-            if (!isset($method->attributes()->name)) {
344
+            if ( ! isset($method->attributes()->name)) {
345 345
                 throw new RuntimeException('The name attribute must be set for all callback-method elements.');
346 346
             }
347 347
 
348
-            switch ((string)$method->attributes()->type) {
348
+            switch ((string) $method->attributes()->type) {
349 349
                 case 'pre-serialize':
350
-                    $metadata->addPreSerializeMethod(new MethodMetadata($name, (string)$method->attributes()->name));
350
+                    $metadata->addPreSerializeMethod(new MethodMetadata($name, (string) $method->attributes()->name));
351 351
                     break;
352 352
 
353 353
                 case 'post-serialize':
354
-                    $metadata->addPostSerializeMethod(new MethodMetadata($name, (string)$method->attributes()->name));
354
+                    $metadata->addPostSerializeMethod(new MethodMetadata($name, (string) $method->attributes()->name));
355 355
                     break;
356 356
 
357 357
                 case 'post-deserialize':
358
-                    $metadata->addPostDeserializeMethod(new MethodMetadata($name, (string)$method->attributes()->name));
358
+                    $metadata->addPostDeserializeMethod(new MethodMetadata($name, (string) $method->attributes()->name));
359 359
                     break;
360 360
 
361 361
                 case 'handler':
362
-                    if (!isset($method->attributes()->format)) {
362
+                    if ( ! isset($method->attributes()->format)) {
363 363
                         throw new RuntimeException('The format attribute must be set for "handler" callback methods.');
364 364
                     }
365
-                    if (!isset($method->attributes()->direction)) {
365
+                    if ( ! isset($method->attributes()->direction)) {
366 366
                         throw new RuntimeException('The direction attribute must be set for "handler" callback methods.');
367 367
                     }
368 368
 
Please login to merge, or discard this patch.