Completed
Pull Request — master (#794)
by Pauline
14:49
created
src/GraphNavigator.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,8 +82,7 @@
 block discarded – undo
82 82
         ObjectConstructorInterface $objectConstructor,
83 83
         EventDispatcherInterface $dispatcher = null,
84 84
         ExpressionEvaluatorInterface $expressionEvaluator = null
85
-    )
86
-    {
85
+    ) {
87 86
         $this->dispatcher = $dispatcher;
88 87
         $this->metadataFactory = $metadataFactory;
89 88
         $this->handlerRegistry = $handlerRegistry;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             case 'resource':
151 151
                 $msg = 'Resources are not supported in serialized data.';
152 152
                 if ($context instanceof SerializationContext && null !== $path = $context->getPath()) {
153
-                    $msg .= ' Path: ' . $path;
153
+                    $msg .= ' Path: '.$path;
154 154
                 }
155 155
 
156 156
                 throw new RuntimeException($msg);
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
                 /** @var $metadata ClassMetadata */
207 207
                 $metadata = $this->metadataFactory->getMetadataForClass($type['name']);
208 208
 
209
-                if ($metadata->usingExpression && !$this->expressionExclusionStrategy) {
209
+                if ($metadata->usingExpression && ! $this->expressionExclusionStrategy) {
210 210
                     throw new ExpressionLanguageRequiredException("To use conditional exclude/expose in {$metadata->name} you must configure the expression language.");
211 211
                 }
212 212
 
213
-                if ($context instanceof DeserializationContext && !empty($metadata->discriminatorMap) && $type['name'] === $metadata->discriminatorBaseClass) {
213
+                if ($context instanceof DeserializationContext && ! empty($metadata->discriminatorMap) && $type['name'] === $metadata->discriminatorBaseClass) {
214 214
                     $metadata = $this->resolveMetadata($data, $metadata);
215 215
                 }
216 216
 
@@ -280,22 +280,22 @@  discard block
 block discarded – undo
280 280
     {
281 281
         switch (true) {
282 282
             case is_array($data) && isset($data[$metadata->discriminatorFieldName]):
283
-                $typeValue = (string)$data[$metadata->discriminatorFieldName];
283
+                $typeValue = (string) $data[$metadata->discriminatorFieldName];
284 284
                 break;
285 285
 
286 286
             // Check XML attribute for discriminatorFieldName
287 287
             case is_object($data) && $metadata->xmlDiscriminatorAttribute && isset($data[$metadata->discriminatorFieldName]):
288
-                $typeValue = (string)$data[$metadata->discriminatorFieldName];
288
+                $typeValue = (string) $data[$metadata->discriminatorFieldName];
289 289
                 break;
290 290
 
291 291
             // Check XML element with namespace for discriminatorFieldName
292
-            case is_object($data) && !$metadata->xmlDiscriminatorAttribute && null !== $metadata->xmlDiscriminatorNamespace && isset($data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName}):
293
-                $typeValue = (string)$data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName};
292
+            case is_object($data) && ! $metadata->xmlDiscriminatorAttribute && null !== $metadata->xmlDiscriminatorNamespace && isset($data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName}):
293
+                $typeValue = (string) $data->children($metadata->xmlDiscriminatorNamespace)->{$metadata->discriminatorFieldName};
294 294
                 break;
295 295
 
296 296
             // Check XML element for discriminatorFieldName
297 297
             case is_object($data) && isset($data->{$metadata->discriminatorFieldName}):
298
-                $typeValue = (string)$data->{$metadata->discriminatorFieldName};
298
+                $typeValue = (string) $data->{$metadata->discriminatorFieldName};
299 299
                 break;
300 300
 
301 301
             default:
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 ));
307 307
         }
308 308
 
309
-        if (!isset($metadata->discriminatorMap[$typeValue])) {
309
+        if ( ! isset($metadata->discriminatorMap[$typeValue])) {
310 310
             throw new \LogicException(sprintf(
311 311
                 'The type value "%s" does not exist in the discriminator map of class "%s". Available types: %s',
312 312
                 $typeValue,
Please login to merge, or discard this patch.
src/Serializer.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,8 +83,7 @@
 block discarded – undo
83 83
         EventDispatcherInterface $dispatcher = null,
84 84
         TypeParser $typeParser = null,
85 85
         ExpressionEvaluatorInterface $expressionEvaluator = null
86
-    )
87
-    {
86
+    ) {
88 87
         $this->factory = $factory;
89 88
         $this->handlerRegistry = $handlerRegistry;
90 89
         $this->objectConstructor = $objectConstructor;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         }
107 107
 
108 108
         return $this->serializationVisitors->get($format)
109
-            ->map(function (VisitorInterface $visitor) use ($context, $data, $format) {
109
+            ->map(function(VisitorInterface $visitor) use ($context, $data, $format) {
110 110
                 $type = $context->getInitialType() !== null ? $this->typeParser->parse($context->getInitialType()) : null;
111 111
 
112 112
                 $this->visit($visitor, $context, $visitor->prepare($data), $format, $type);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         }
124 124
 
125 125
         return $this->deserializationVisitors->get($format)
126
-            ->map(function (VisitorInterface $visitor) use ($context, $data, $format, $type) {
126
+            ->map(function(VisitorInterface $visitor) use ($context, $data, $format, $type) {
127 127
                 $preparedData = $visitor->prepare($data);
128 128
                 $navigatorResult = $this->visit($visitor, $context, $preparedData, $format, $this->typeParser->parse($type));
129 129
 
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
         }
143 143
 
144 144
         return $this->serializationVisitors->get('json')
145
-            ->map(function (JsonSerializationVisitor $visitor) use ($context, $data) {
145
+            ->map(function(JsonSerializationVisitor $visitor) use ($context, $data) {
146 146
                 $type = $context->getInitialType() !== null ? $this->typeParser->parse($context->getInitialType()) : null;
147 147
 
148 148
                 $this->visit($visitor, $context, $data, 'json', $type);
149 149
                 $result = $this->convertArrayObjects($visitor->getRoot());
150 150
 
151
-                if (!is_array($result)) {
151
+                if ( ! is_array($result)) {
152 152
                     throw new RuntimeException(sprintf(
153 153
                         'The input data of type "%s" did not convert to an array, but got a result of type "%s".',
154 154
                         is_object($data) ? get_class($data) : gettype($data),
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         }
172 172
 
173 173
         return $this->deserializationVisitors->get('json')
174
-            ->map(function (JsonDeserializationVisitor $visitor) use ($data, $type, $context) {
174
+            ->map(function(JsonDeserializationVisitor $visitor) use ($data, $type, $context) {
175 175
                 $navigatorResult = $this->visit($visitor, $context, $data, 'json', $this->typeParser->parse($type));
176 176
 
177 177
                 return $this->handleDeserializeResult($visitor->getResult(), $navigatorResult);
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     private function convertArrayObjects($data)
207 207
     {
208 208
         if ($data instanceof \ArrayObject || $data instanceof \stdClass) {
209
-            $data = (array)$data;
209
+            $data = (array) $data;
210 210
         }
211 211
         if (is_array($data)) {
212 212
             foreach ($data as $k => $v) {
Please login to merge, or discard this patch.
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/XmlSerializationVisitor.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -127,6 +127,9 @@  discard block
 block discarded – undo
127 127
         return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string)$data);
128 128
     }
129 129
 
130
+    /**
131
+     * @param string $data
132
+     */
130 133
     public function visitSimpleString($data, array $type, Context $context)
131 134
     {
132 135
         if (null === $this->document) {
@@ -474,6 +477,9 @@  discard block
 block discarded – undo
474 477
         return $this->document->createElementNS($namespace, $prefix . ':' . $tagName);
475 478
     }
476 479
 
480
+    /**
481
+     * @param string $value
482
+     */
477 483
     private function setAttributeOnNode(\DOMElement $node, $name, $value, $namespace = null)
478 484
     {
479 485
         if (null !== $namespace) {
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -124,24 +124,24 @@  discard block
 block discarded – undo
124 124
 
125 125
         if (null === $this->document) {
126 126
             $this->document = $this->createDocument(null, null, true);
127
-            $this->currentNode->appendChild($doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string)$data));
127
+            $this->currentNode->appendChild($doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string) $data));
128 128
 
129 129
             return;
130 130
         }
131 131
 
132
-        return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string)$data);
132
+        return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string) $data);
133 133
     }
134 134
 
135 135
     public function visitSimpleString($data, array $type, Context $context)
136 136
     {
137 137
         if (null === $this->document) {
138 138
             $this->document = $this->createDocument(null, null, true);
139
-            $this->currentNode->appendChild($this->document->createTextNode((string)$data));
139
+            $this->currentNode->appendChild($this->document->createTextNode((string) $data));
140 140
 
141 141
             return;
142 142
         }
143 143
 
144
-        return $this->document->createTextNode((string)$data);
144
+        return $this->document->createTextNode((string) $data);
145 145
     }
146 146
 
147 147
     public function visitBoolean($data, array $type, Context $context)
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             $this->setCurrentNode($entryNode);
190 190
 
191 191
             if (null !== $keyAttributeName) {
192
-                $entryNode->setAttribute($keyAttributeName, (string)$k);
192
+                $entryNode->setAttribute($keyAttributeName, (string) $k);
193 193
             }
194 194
 
195 195
             if (null !== $node = $this->navigator->accept($v, $this->getElementType($type), $context)) {
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
             $node = $this->navigator->accept($v, $metadata->type, $context);
242 242
             $this->revertCurrentMetadata();
243 243
 
244
-            if (!$node instanceof \DOMCharacterData) {
244
+            if ( ! $node instanceof \DOMCharacterData) {
245 245
                 throw new RuntimeException(sprintf('Unsupported value for XML attribute for %s. Expected character data, but got %s.', $metadata->name, json_encode($v)));
246 246
             }
247 247
             $attributeName = $this->namingStrategy->translateName($metadata);
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         }
252 252
 
253 253
         if (($metadata->xmlValue && $this->currentNode->childNodes->length > 0)
254
-            || (!$metadata->xmlValue && $this->hasValue)
254
+            || ( ! $metadata->xmlValue && $this->hasValue)
255 255
         ) {
256 256
             throw new RuntimeException(sprintf('If you make use of @XmlValue, all other properties in the class must have the @XmlAttribute annotation. Invalid usage detected in class %s.', $metadata->class));
257 257
         }
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
             $node = $this->navigator->accept($v, $metadata->type, $context);
264 264
             $this->revertCurrentMetadata();
265 265
 
266
-            if (!$node instanceof \DOMCharacterData) {
266
+            if ( ! $node instanceof \DOMCharacterData) {
267 267
                 throw new RuntimeException(sprintf('Unsupported value for property %s::$%s. Expected character data, but got %s.', $metadata->reflection->class, $metadata->reflection->name, is_object($node) ? get_class($node) : gettype($node)));
268 268
             }
269 269
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
         }
274 274
 
275 275
         if ($metadata->xmlAttributeMap) {
276
-            if (!is_array($v)) {
276
+            if ( ! is_array($v)) {
277 277
                 throw new RuntimeException(sprintf('Unsupported value type for XML attribute map. Expected array but got %s.', gettype($v)));
278 278
             }
279 279
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
                 $node = $this->navigator->accept($value, null, $context);
283 283
                 $this->revertCurrentMetadata();
284 284
 
285
-                if (!$node instanceof \DOMCharacterData) {
285
+                if ( ! $node instanceof \DOMCharacterData) {
286 286
                     throw new RuntimeException(sprintf('Unsupported value for a XML attribute map value. Expected character data, but got %s.', json_encode($v)));
287 287
                 }
288 288
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
             return;
293 293
         }
294 294
 
295
-        if ($addEnclosingElement = !$this->isInLineCollection($metadata) && !$metadata->inline) {
295
+        if ($addEnclosingElement = ! $this->isInLineCollection($metadata) && ! $metadata->inline) {
296 296
             $elementName = $this->namingStrategy->translateName($metadata);
297 297
 
298 298
             $namespace = null !== $metadata->xmlNamespace
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 
336 336
     private function isSkippableEmptyObject($node, PropertyMetadata $metadata)
337 337
     {
338
-        return $node === null && !$metadata->xmlCollection && $metadata->skipWhenEmpty;
338
+        return $node === null && ! $metadata->xmlCollection && $metadata->skipWhenEmpty;
339 339
     }
340 340
 
341 341
     private function isSkippableCollection(PropertyMetadata $metadata)
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 
346 346
     private function isElementEmpty(\DOMElement $element)
347 347
     {
348
-        return !$element->hasChildNodes() && !$element->hasAttributes();
348
+        return ! $element->hasChildNodes() && ! $element->hasAttributes();
349 349
     }
350 350
 
351 351
     public function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)
@@ -424,12 +424,12 @@  discard block
 block discarded – undo
424 424
     {
425 425
         if (null === $this->document) {
426 426
             $this->document = $this->createDocument(null, null, true);
427
-            $this->currentNode->appendChild($textNode = $this->document->createTextNode((string)$data));
427
+            $this->currentNode->appendChild($textNode = $this->document->createTextNode((string) $data));
428 428
 
429 429
             return $textNode;
430 430
         }
431 431
 
432
-        return $this->document->createTextNode((string)$data);
432
+        return $this->document->createTextNode((string) $data);
433 433
     }
434 434
 
435 435
     /**
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 
447 447
     private function attachNullNamespace()
448 448
     {
449
-        if (!$this->nullWasVisited) {
449
+        if ( ! $this->nullWasVisited) {
450 450
             $this->document->documentElement->setAttributeNS(
451 451
                 'http://www.w3.org/2000/xmlns/',
452 452
                 'xmlns:xsi',
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
         foreach ($metadata->xmlNamespaces as $prefix => $uri) {
468 468
             $attribute = 'xmlns';
469 469
             if ($prefix !== '') {
470
-                $attribute .= ':' . $prefix;
470
+                $attribute .= ':'.$prefix;
471 471
             } elseif ($element->namespaceURI === $uri) {
472 472
                 continue;
473 473
             }
@@ -483,19 +483,19 @@  discard block
 block discarded – undo
483 483
         if ($this->currentNode->isDefaultNamespace($namespace)) {
484 484
             return $this->document->createElementNS($namespace, $tagName);
485 485
         }
486
-        if (!($prefix = $this->currentNode->lookupPrefix($namespace)) && !($prefix = $this->document->lookupPrefix($namespace))) {
487
-            $prefix = 'ns-' . substr(sha1($namespace), 0, 8);
486
+        if ( ! ($prefix = $this->currentNode->lookupPrefix($namespace)) && ! ($prefix = $this->document->lookupPrefix($namespace))) {
487
+            $prefix = 'ns-'.substr(sha1($namespace), 0, 8);
488 488
         }
489
-        return $this->document->createElementNS($namespace, $prefix . ':' . $tagName);
489
+        return $this->document->createElementNS($namespace, $prefix.':'.$tagName);
490 490
     }
491 491
 
492 492
     private function setAttributeOnNode(\DOMElement $node, $name, $value, $namespace = null)
493 493
     {
494 494
         if (null !== $namespace) {
495
-            if (!$prefix = $node->lookupPrefix($namespace)) {
496
-                $prefix = 'ns-' . substr(sha1($namespace), 0, 8);
495
+            if ( ! $prefix = $node->lookupPrefix($namespace)) {
496
+                $prefix = 'ns-'.substr(sha1($namespace), 0, 8);
497 497
             }
498
-            $node->setAttributeNS($namespace, $prefix . ':' . $name, $value);
498
+            $node->setAttributeNS($namespace, $prefix.':'.$name, $value);
499 499
         } else {
500 500
             $node->setAttribute($name, $value);
501 501
         }
@@ -519,6 +519,6 @@  discard block
 block discarded – undo
519 519
      */
520 520
     public function setFormatOutput($formatOutput)
521 521
     {
522
-        $this->formatOutput = (boolean)$formatOutput;
522
+        $this->formatOutput = (boolean) $formatOutput;
523 523
     }
524 524
 }
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.