Completed
Pull Request — master (#539)
by Delf
42:09 queued 25:33
created
src/JMS/Serializer/EventDispatcher/EventDispatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
             $this->classListeners[$eventName][$loweredClass][$format] = $this->initializeListeners($eventName, $loweredClass, $format);
81 81
         }
82 82
 
83
-        return !!$this->classListeners[$eventName][$loweredClass][$format];
83
+        return ! ! $this->classListeners[$eventName][$loweredClass][$format];
84 84
     }
85 85
 
86 86
     public function dispatch($eventName, $class, $format, Event $event)
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/Driver/YamlDriver.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@
 block discarded – undo
167 167
 
168 168
                     //we need read_only before setter and getter set, because that method depends on flag being set
169 169
                     if (isset($pConfig['read_only'])) {
170
-                          $pMetadata->readOnly = (Boolean) $pConfig['read_only'];
170
+                            $pMetadata->readOnly = (Boolean) $pConfig['read_only'];
171 171
                     } else {
172 172
                         $pMetadata->readOnly = $pMetadata->readOnly || $readOnlyClass;
173 173
                     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -113,15 +113,15 @@
 block discarded – undo
113 113
 
114 114
                         $colConfig = $pConfig['xml_list'];
115 115
                         if (isset($colConfig['inline'])) {
116
-                            $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline'];
116
+                            $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline'];
117 117
                         }
118 118
 
119 119
                         if (isset($colConfig['entry_name'])) {
120
-                            $pMetadata->xmlEntryName = (string)$colConfig['entry_name'];
120
+                            $pMetadata->xmlEntryName = (string) $colConfig['entry_name'];
121 121
                         }
122 122
 
123 123
                         if (isset($colConfig['skip_when_empty'])) {
124
-                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean)$colConfig['skip_when_empty'];
124
+                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean) $colConfig['skip_when_empty'];
125 125
                         } else {
126 126
                             $pMetadata->xmlCollectionSkipWhenEmpty = true;
127 127
                         }
Please login to merge, or discard this patch.
src/JMS/Serializer/TypeParser.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
                 |(.)
50 50
             /x',
51 51
             array(self::T_NAME => 'T_NAME', self::T_STRING => 'T_STRING', self::T_OPEN_BRACKET => 'T_OPEN_BRACKET',
52
-                  self::T_CLOSE_BRACKET => 'T_CLOSE_BRACKET', self::T_COMMA => 'T_COMMA', self::T_NONE => 'T_NONE'),
52
+                    self::T_CLOSE_BRACKET => 'T_CLOSE_BRACKET', self::T_COMMA => 'T_COMMA', self::T_NONE => 'T_NONE'),
53 53
             function($value) {
54 54
                 switch ($value[0]) {
55 55
                     case '"':
Please login to merge, or discard this patch.
src/JMS/Serializer/Util/Writer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,16 +83,16 @@
 block discarded – undo
83 83
         $addition = '';
84 84
 
85 85
         $lines = explode("\n", $content);
86
-        for ($i=0,$c=count($lines); $i<$c; $i++) {
86
+        for ($i = 0, $c = count($lines); $i < $c; $i++) {
87 87
             if ($this->indentationLevel > 0
88
-                && !empty($lines[$i])
88
+                && ! empty($lines[$i])
89 89
                 && ((empty($addition) && "\n" === substr($this->content, -1)) || "\n" === substr($addition, -1))) {
90 90
                 $addition .= str_repeat(' ', $this->indentationLevel * $this->indentationSpaces);
91 91
             }
92 92
 
93 93
             $addition .= $lines[$i];
94 94
 
95
-            if ($i+1 < $c) {
95
+            if ($i + 1 < $c) {
96 96
                 $addition .= "\n";
97 97
             }
98 98
         }
Please login to merge, or discard this patch.
src/JMS/Serializer/YamlSerializationVisitor.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,8 +168,8 @@
 block discarded – undo
168 168
 
169 169
         if ( ! $metadata->inline) {
170 170
             $this->writer
171
-                 ->writeln(Inline::dump($name).':')
172
-                 ->indent();
171
+                    ->writeln(Inline::dump($name).':')
172
+                    ->indent();
173 173
         }
174 174
 
175 175
         $this->setCurrentMetadata($metadata);
Please login to merge, or discard this patch.
src/JMS/Serializer/Exclusion/ExclusionGroupsExclusionStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         if (is_array($metadataGroups) && empty($metadataGroups)) {
55 55
             return true;
56 56
         }
57
-        if (!empty($this->groups) && array_intersect(array_keys($this->groups), $metadataGroups)) {
57
+        if ( ! empty($this->groups) && array_intersect(array_keys($this->groups), $metadataGroups)) {
58 58
             return true;
59 59
         }
60 60
 
Please login to merge, or discard this patch.
src/JMS/Serializer/XmlDeserializationVisitor.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@
 block discarded – undo
226 226
             throw new RuntimeException(sprintf('You must define a type for %s::$%s.', $metadata->reflection->class, $metadata->name));
227 227
         }
228 228
 
229
-       if ($metadata->xmlAttribute) {
229
+        if ($metadata->xmlAttribute) {
230 230
 
231 231
             $attributes = $data->attributes($metadata->xmlNamespace);
232 232
             if (isset($attributes[$name])) {
Please login to merge, or discard this 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,10 +147,10 @@  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
-        if ( ! isset($data->$entryName) ) {
153
+        if ( ! isset($data->$entryName)) {
154 154
             if (null === $this->result) {
155 155
                 return $this->result = array();
156 156
             }
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
         if ($metadata->xmlCollection) {
244 244
             $enclosingElem = $data;
245
-            if (!$metadata->xmlCollectionInline) {
245
+            if ( ! $metadata->xmlCollectionInline) {
246 246
                 $enclosingElem = $data->children($metadata->xmlNamespace)->$name;
247 247
             }
248 248
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
         if ($metadata->xmlNamespace) {
258 258
             $node = $data->children($metadata->xmlNamespace)->$name;
259
-            if (!$node->count()) {
259
+            if ( ! $node->count()) {
260 260
                 return;
261 261
             }
262 262
         } else {
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
             if (isset($namespaces[''])) {
267 267
                 $prefix = uniqid('ns-');
268 268
                 $data->registerXPathNamespace($prefix, $namespaces['']);
269
-                $nodes = $data->xpath('./'.$prefix. ':'.$name );
269
+                $nodes = $data->xpath('./'.$prefix.':'.$name);
270 270
             } else {
271
-                $nodes = $data->xpath('./'. $name );
271
+                $nodes = $data->xpath('./'.$name);
272 272
             }
273 273
             if (empty($nodes)) {
274 274
                 return;
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/Driver/AnnotationDriver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
                     } elseif ($annot instanceof Accessor) {
192 192
                         $accessor = array($annot->getter, $annot->setter);
193 193
                     } elseif ($annot instanceof Exclude) {
194
-                        if (!empty($annot->groups)) {
195
-                            $annotationSource = $propertyMetadata->class . '->' . $propertyMetadata->name;
194
+                        if ( ! empty($annot->groups)) {
195
+                            $annotationSource = $propertyMetadata->class.'->'.$propertyMetadata->name;
196 196
                             $this->sanitizeGroupNames($annot->groups, $annotationSource);
197 197
                             $propertyMetadata->exclusionGroups = $annot->groups;
198 198
                         } else {
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
                     } elseif ($annot instanceof Groups) {
203 203
                         $propertyMetadata->groups = $annot->groups;
204
-                        $annotationSource = $propertyMetadata->class . '->' . $propertyMetadata->name;
204
+                        $annotationSource = $propertyMetadata->class.'->'.$propertyMetadata->name;
205 205
                         $this->sanitizeGroupNames($propertyMetadata->groups, $annotationSource);
206 206
                     } elseif ($annot instanceof Inline) {
207 207
                         $propertyMetadata->inline = true;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     private function sanitizeGroupNames($groups, $annotationSource)
231 231
     {
232
-        foreach ((array)$groups as $groupName) {
232
+        foreach ((array) $groups as $groupName) {
233 233
             if (false !== strpos($groupName, ',')) {
234 234
                 throw new InvalidArgumentException(sprintf(
235 235
                     'Invalid group name "%s" on "%s", did you mean to create multiple groups?',
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/PropertyMetadata.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -166,10 +166,10 @@
 block discarded – undo
166 166
             $parentStr
167 167
         ) = $unserialized;
168 168
 
169
-        if (isset($unserialized['xmlEntryNamespace'])){
169
+        if (isset($unserialized['xmlEntryNamespace'])) {
170 170
             $this->xmlEntryNamespace = $unserialized['xmlEntryNamespace'];
171 171
         }
172
-        if (isset($unserialized['xmlCollectionSkipWhenEmpty'])){
172
+        if (isset($unserialized['xmlCollectionSkipWhenEmpty'])) {
173 173
             $this->xmlCollectionSkipWhenEmpty = $unserialized['xmlCollectionSkipWhenEmpty'];
174 174
         }
175 175
         
Please login to merge, or discard this patch.