Completed
Pull Request — master (#754)
by Dmitriy
15:21
created
src/JMS/Serializer/XmlDeserializationVisitor.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
         if (false !== stripos($data, '<!doctype')) {
65 65
             $internalSubset = $this->getDomDocumentTypeEntitySubset($data);
66
-            if (!in_array($internalSubset, $this->doctypeWhitelist, true)) {
66
+            if ( ! in_array($internalSubset, $this->doctypeWhitelist, true)) {
67 67
                 throw new InvalidArgumentException(sprintf(
68 68
                     'The document type "%s" is not allowed. If it is safe, you may add it to the whitelist configuration.',
69 69
                     $internalSubset
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
         if ($namespace === null && $this->objectMetadataStack->count()) {
149 149
             $classMetadata = $this->objectMetadataStack->top();
150
-            $namespace = isset($classMetadata->xmlNamespaces[''])?$classMetadata->xmlNamespaces['']:$namespace;
150
+            $namespace = isset($classMetadata->xmlNamespaces['']) ? $classMetadata->xmlNamespaces[''] : $namespace;
151 151
         }
152 152
 
153 153
         if (null !== $namespace) {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $nodes = $data->xpath($entryName);
159 159
         }
160 160
 
161
-        if (!count($nodes)) {
161
+        if ( ! count($nodes)) {
162 162
             if (null === $this->result) {
163 163
                 return $this->result = array();
164 164
             }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
         if ($metadata->xmlCollection) {
251 251
             $enclosingElem = $data;
252
-            if (!$metadata->xmlCollectionInline) {
252
+            if ( ! $metadata->xmlCollectionInline) {
253 253
                 $enclosingElem = $data->children($metadata->xmlNamespace)->$name;
254 254
             }
255 255
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 
264 264
         if ($metadata->xmlNamespace) {
265 265
             $node = $data->children($metadata->xmlNamespace)->$name;
266
-            if (!$node->count()) {
266
+            if ( ! $node->count()) {
267 267
                 return;
268 268
             }
269 269
         } else {
@@ -273,9 +273,9 @@  discard block
 block discarded – undo
273 273
             if (isset($namespaces[''])) {
274 274
                 $prefix = uniqid('ns-');
275 275
                 $data->registerXPathNamespace($prefix, $namespaces['']);
276
-                $nodes = $data->xpath('./'.$prefix. ':'.$name );
276
+                $nodes = $data->xpath('./'.$prefix.':'.$name);
277 277
             } else {
278
-                $nodes = $data->xpath('./'. $name );
278
+                $nodes = $data->xpath('./'.$name);
279 279
             }
280 280
             if (empty($nodes)) {
281 281
                 return;
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/ExpressionPropertyMetadata.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,10 +115,10 @@
 block discarded – undo
115 115
             $this->name
116 116
         ) = $unserialized;
117 117
 
118
-        if (isset($unserialized['excludeIf'])){
118
+        if (isset($unserialized['excludeIf'])) {
119 119
             $this->excludeIf = $unserialized['excludeIf'];
120 120
         }
121
-        if (isset($unserialized['expression'])){
121
+        if (isset($unserialized['expression'])) {
122 122
             $this->expression = $unserialized['expression'];
123 123
         }
124 124
     }
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/Driver/XmlDriver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         foreach ($elem->xpath('./virtual-property') as $method) {
118 118
 
119 119
             if (isset($method->attributes()->expression)) {
120
-                $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, (string)$method->attributes()->name, (string)$method->attributes()->expression);
120
+                $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, (string) $method->attributes()->name, (string) $method->attributes()->expression);
121 121
             } else {
122 122
                 if ( ! isset($method->attributes()->method)) {
123 123
                     throw new RuntimeException('The method attribute must be set for all virtual-property elements.');
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
                     }
160 160
 
161 161
                     if (null !== $excludeIf = $pElem->attributes()->{'exclude-if'}) {
162
-                        $pMetadata->excludeIf =$excludeIf;
162
+                        $pMetadata->excludeIf = $excludeIf;
163 163
                     }
164 164
 
165 165
                     if (null !== $excludeIf = $pElem->attributes()->{'expose-if'}) {
166
-                        $pMetadata->excludeIf = "!(" . $excludeIf .")";
166
+                        $pMetadata->excludeIf = "!(".$excludeIf.")";
167 167
                         $isExpose = true;
168 168
                     }
169 169
 
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/Driver/YamlDriver.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         if (array_key_exists('virtual_properties', $config)) {
54 54
             foreach ($config['virtual_properties'] as $methodName => $propertySettings) {
55 55
                 if (isset($propertySettings['exp'])) {
56
-                    $virtualPropertyMetadata = new ExpressionPropertyMetadata( $name, $methodName, $propertySettings['exp']);
56
+                    $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, $methodName, $propertySettings['exp']);
57 57
                     unset($propertySettings['exp']);
58 58
 
59 59
                 } else {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                     }
108 108
 
109 109
                     if (isset($pConfig['expose_if'])) {
110
-                        $pMetadata->excludeIf = "!(" . $pConfig['expose_if'].")";
110
+                        $pMetadata->excludeIf = "!(".$pConfig['expose_if'].")";
111 111
                     }
112 112
 
113 113
                     if (isset($pConfig['serialized_name'])) {
@@ -127,15 +127,15 @@  discard block
 block discarded – undo
127 127
 
128 128
                         $colConfig = $pConfig['xml_list'];
129 129
                         if (isset($colConfig['inline'])) {
130
-                            $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline'];
130
+                            $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline'];
131 131
                         }
132 132
 
133 133
                         if (isset($colConfig['entry_name'])) {
134
-                            $pMetadata->xmlEntryName = (string)$colConfig['entry_name'];
134
+                            $pMetadata->xmlEntryName = (string) $colConfig['entry_name'];
135 135
                         }
136 136
 
137 137
                         if (isset($colConfig['skip_when_empty'])) {
138
-                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean)$colConfig['skip_when_empty'];
138
+                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean) $colConfig['skip_when_empty'];
139 139
                         } else {
140 140
                             $pMetadata->xmlCollectionSkipWhenEmpty = true;
141 141
                         }
Please login to merge, or discard this patch.
src/JMS/Serializer/SerializerBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
 
116 116
     protected 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) {
Please login to merge, or discard this patch.
src/JMS/Serializer/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/JMS/Serializer/Exclusion/GroupsExclusionStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 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/JMS/Serializer/YamlSerializationVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
                 continue;
92 92
             }
93 93
 
94
-            if ($isList && !$isHash) {
94
+            if ($isList && ! $isHash) {
95 95
                 $this->writer->writeln('-');
96 96
             } else {
97 97
                 $this->writer->writeln(Inline::dump($k).':');
Please login to merge, or discard this patch.
src/JMS/Serializer/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.