Completed
Pull Request — master (#794)
by Pauline
14:49
created
src/Metadata/ClassMetadata.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function setAccessorOrder($order, array $customOrder = array())
90 90
     {
91
-        if (!in_array($order, array(self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM), true)) {
91
+        if ( ! in_array($order, array(self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM), true)) {
92 92
             throw new InvalidArgumentException(sprintf('The accessor order "%s" is invalid.', $order));
93 93
         }
94 94
 
95 95
         foreach ($customOrder as $name) {
96
-            if (!is_string($name)) {
96
+            if ( ! is_string($name)) {
97 97
                 throw new InvalidArgumentException(sprintf('$customOrder is expected to be a list of strings, but got element of value %s.', json_encode($name)));
98 98
             }
99 99
         }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
     public function merge(MergeableInterface $object)
131 131
     {
132
-        if (!$object instanceof ClassMetadata) {
132
+        if ( ! $object instanceof ClassMetadata) {
133 133
             throw new InvalidArgumentException('$object must be an instance of ClassMetadata.');
134 134
         }
135 135
         parent::merge($object);
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
                 $this->discriminatorBaseClass,
154 154
                 $this->discriminatorBaseClass
155 155
             ));
156
-        } elseif (!$this->discriminatorFieldName && $object->discriminatorFieldName) {
156
+        } elseif ( ! $this->discriminatorFieldName && $object->discriminatorFieldName) {
157 157
             $this->discriminatorFieldName = $object->discriminatorFieldName;
158 158
             $this->discriminatorMap = $object->discriminatorMap;
159 159
         }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             $this->discriminatorBaseClass = $object->discriminatorBaseClass;
169 169
         }
170 170
 
171
-        if ($this->discriminatorMap && !$this->reflection->isAbstract()) {
171
+        if ($this->discriminatorMap && ! $this->reflection->isAbstract()) {
172 172
             if (false === $typeValue = array_search($this->name, $this->discriminatorMap, true)) {
173 173
                 throw new \LogicException(sprintf(
174 174
                     'The sub-class "%s" is not listed in the discriminator of the base class "%s".',
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             $this->discriminatorValue = $typeValue;
181 181
 
182 182
             if (isset($this->propertyMetadata[$this->discriminatorFieldName])
183
-                && !$this->propertyMetadata[$this->discriminatorFieldName] instanceof StaticPropertyMetadata
183
+                && ! $this->propertyMetadata[$this->discriminatorFieldName] instanceof StaticPropertyMetadata
184 184
             ) {
185 185
                 throw new \LogicException(sprintf(
186 186
                     'The discriminator field name "%s" of the base-class "%s" conflicts with a regular property of the sub-class "%s".',
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
 
208 208
     public function registerNamespace($uri, $prefix = null)
209 209
     {
210
-        if (!is_string($uri)) {
210
+        if ( ! is_string($uri)) {
211 211
             throw new InvalidArgumentException(sprintf('$uri is expected to be a strings, but got value %s.', json_encode($uri)));
212 212
         }
213 213
 
214 214
         if ($prefix !== null) {
215
-            if (!is_string($prefix)) {
215
+            if ( ! is_string($prefix)) {
216 216
                 throw new InvalidArgumentException(sprintf('$prefix is expected to be a strings, but got value %s.', json_encode($prefix)));
217 217
             }
218 218
         } else {
@@ -300,19 +300,19 @@  discard block
 block discarded – undo
300 300
             case self::ACCESSOR_ORDER_CUSTOM:
301 301
                 $order = $this->customOrder;
302 302
                 $currentSorting = $this->propertyMetadata ? array_combine(array_keys($this->propertyMetadata), range(1, count($this->propertyMetadata))) : [];
303
-                uksort($this->propertyMetadata, function ($a, $b) use ($order, $currentSorting) {
303
+                uksort($this->propertyMetadata, function($a, $b) use ($order, $currentSorting) {
304 304
                     $existsA = isset($order[$a]);
305 305
                     $existsB = isset($order[$b]);
306 306
 
307
-                    if (!$existsA && !$existsB) {
307
+                    if ( ! $existsA && ! $existsB) {
308 308
                         return $currentSorting[$a] - $currentSorting[$b];
309 309
                     }
310 310
 
311
-                    if (!$existsA) {
311
+                    if ( ! $existsA) {
312 312
                         return 1;
313 313
                     }
314 314
 
315
-                    if (!$existsB) {
315
+                    if ( ! $existsB) {
316 316
                         return -1;
317 317
                     }
318 318
 
Please login to merge, or discard this patch.
src/Metadata/Driver/AbstractDoctrineTypeDriver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $classMetadata = $this->delegate->loadMetadataForClass($class);
84 84
 
85 85
         // Abort if the given class is not a mapped entity
86
-        if (!$doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) {
86
+        if ( ! $doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) {
87 87
             return $classMetadata;
88 88
         }
89 89
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     protected function tryLoadingDoctrineMetadata($className)
150 150
     {
151
-        if (!$manager = $this->registry->getManagerForClass($className)) {
151
+        if ( ! $manager = $this->registry->getManagerForClass($className)) {
152 152
             return null;
153 153
         }
154 154
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     protected function normalizeFieldType($type)
166 166
     {
167
-        if (!isset($this->fieldMapping[$type])) {
167
+        if ( ! isset($this->fieldMapping[$type])) {
168 168
             return;
169 169
         }
170 170
 
Please login to merge, or discard this patch.
src/Metadata/Driver/DoctrinePHPCRTypeDriver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $propertyName = $propertyMetadata->name;
44 44
         if ($doctrineMetadata->hasField($propertyName) && $fieldType = $this->normalizeFieldType($doctrineMetadata->getTypeOfField($propertyName))) {
45 45
             $field = $doctrineMetadata->getFieldMapping($propertyName);
46
-            if (!empty($field['multivalue'])) {
46
+            if ( ! empty($field['multivalue'])) {
47 47
                 $fieldType = 'array';
48 48
             }
49 49
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
                 return;
60 60
             }
61 61
 
62
-            if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) {
62
+            if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) {
63 63
                 $targetEntity = "ArrayCollection<{$targetEntity}>";
64 64
             }
65 65
 
Please login to merge, or discard this patch.
src/Metadata/Driver/DoctrineTypeDriver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 {
31 31
     protected function setDiscriminator(DoctrineClassMetadata $doctrineMetadata, ClassMetadata $classMetadata)
32 32
     {
33
-        if (empty($classMetadata->discriminatorMap) && !$classMetadata->discriminatorDisabled
34
-            && !empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity()
33
+        if (empty($classMetadata->discriminatorMap) && ! $classMetadata->discriminatorDisabled
34
+            && ! empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity()
35 35
         ) {
36 36
             $classMetadata->setDiscriminator(
37 37
                 $doctrineMetadata->discriminatorColumn['name'],
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
             // For inheritance schemes, we cannot add any type as we would only add the super-type of the hierarchy.
56 56
             // On serialization, this would lead to only the supertype being serialized, and properties of subtypes
57 57
             // being ignored.
58
-            if ($targetMetadata instanceof DoctrineClassMetadata && !$targetMetadata->isInheritanceTypeNone()) {
58
+            if ($targetMetadata instanceof DoctrineClassMetadata && ! $targetMetadata->isInheritanceTypeNone()) {
59 59
                 return;
60 60
             }
61 61
 
62
-            if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) {
62
+            if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) {
63 63
                 $targetEntity = "ArrayCollection<{$targetEntity}>";
64 64
             }
65 65
 
Please login to merge, or discard this patch.
src/YamlSerializationVisitor.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $isHash = isset($type['params'][1]);
85 85
 
86 86
         $count = $this->writer->changeCount;
87
-        $isList = (isset($type['params'][0]) && !isset($type['params'][1]))
87
+        $isList = (isset($type['params'][0]) && ! isset($type['params'][1]))
88 88
             || array_keys($data) === range(0, count($data) - 1);
89 89
 
90 90
         foreach ($data as $k => $v) {
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
                 continue;
93 93
             }
94 94
 
95
-            if ($isList && !$isHash) {
95
+            if ($isList && ! $isHash) {
96 96
                 $this->writer->writeln('-');
97 97
             } else {
98
-                $this->writer->writeln(Inline::dump($k) . ':');
98
+                $this->writer->writeln(Inline::dump($k).':');
99 99
             }
100 100
 
101 101
             $this->writer->indent();
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             if (null !== $v = $this->navigator->accept($v, $this->getElementType($type), $context)) {
104 104
                 $this->writer
105 105
                     ->rtrim(false)
106
-                    ->writeln(' ' . $v);
106
+                    ->writeln(' '.$v);
107 107
             }
108 108
 
109 109
             $this->writer->outdent();
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
     public function visitDouble($data, array $type, Context $context)
135 135
     {
136
-        $v = (string)$data;
136
+        $v = (string) $data;
137 137
 
138 138
         if ('' === $this->writer->content) {
139 139
             $this->writer->writeln($v);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
     public function visitInteger($data, array $type, Context $context)
146 146
     {
147
-        $v = (string)$data;
147
+        $v = (string) $data;
148 148
 
149 149
         if ('' === $this->writer->content) {
150 150
             $this->writer->writeln($v);
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
 
168 168
         $name = $this->namingStrategy->translateName($metadata);
169 169
 
170
-        if (!$metadata->inline) {
170
+        if ( ! $metadata->inline) {
171 171
             $this->writer
172
-                ->writeln(Inline::dump($name) . ':')
172
+                ->writeln(Inline::dump($name).':')
173 173
                 ->indent();
174 174
         }
175 175
 
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
         if (null !== $v = $this->navigator->accept($v, $metadata->type, $context)) {
181 181
             $this->writer
182 182
                 ->rtrim(false)
183
-                ->writeln(' ' . $v);
184
-        } elseif ($count === $this->writer->changeCount && !$metadata->inline) {
183
+                ->writeln(' '.$v);
184
+        } elseif ($count === $this->writer->changeCount && ! $metadata->inline) {
185 185
             $this->writer->revert();
186 186
         }
187 187
 
188
-        if (!$metadata->inline) {
188
+        if ( ! $metadata->inline) {
189 189
             $this->writer->outdent();
190 190
         }
191 191
         $this->revertCurrentMetadata();
Please login to merge, or discard this patch.
src/Annotation/SerializedName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
     public function __construct(array $values)
32 32
     {
33
-        if (!isset($values['value']) || !is_string($values['value'])) {
33
+        if ( ! isset($values['value']) || ! is_string($values['value'])) {
34 34
             throw new RuntimeException(sprintf('"value" must be a string.'));
35 35
         }
36 36
 
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)
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/GenericSerializationVisitor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             $this->root = $data;
59 59
         }
60 60
 
61
-        return (string)$data;
61
+        return (string) $data;
62 62
     }
63 63
 
64 64
     public function visitBoolean($data, array $type, Context $context)
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             $this->root = $data;
68 68
         }
69 69
 
70
-        return (boolean)$data;
70
+        return (boolean) $data;
71 71
     }
72 72
 
73 73
     public function visitInteger($data, array $type, Context $context)
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $this->root = $data;
77 77
         }
78 78
 
79
-        return (int)$data;
79
+        return (int) $data;
80 80
     }
81 81
 
82 82
     public function visitDouble($data, array $type, Context $context)
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             $this->root = $data;
86 86
         }
87 87
 
88
-        return (float)$data;
88
+        return (float) $data;
89 89
     }
90 90
 
91 91
     /**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             $rs = $isHash ? new \ArrayObject() : array();
106 106
         }
107 107
 
108
-        $isList = isset($type['params'][0]) && !isset($type['params'][1]);
108
+        $isList = isset($type['params'][0]) && ! isset($type['params'][1]);
109 109
 
110 110
         foreach ($data as $k => $v) {
111 111
             $v = $this->navigator->accept($v, $this->getElementType($type), $context);
Please login to merge, or discard this patch.
src/Metadata/Driver/YamlDriver.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $config = Yaml::parse(file_get_contents($file));
37 37
 
38
-        if (!isset($config[$name = $class->name])) {
38
+        if ( ! isset($config[$name = $class->name])) {
39 39
             throw new RuntimeException(sprintf('Expected metadata for class %s to be defined in %s.', $class->name, $file));
40 40
         }
41 41
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
         $metadata->fileResources[] = $file;
45 45
         $metadata->fileResources[] = $class->getFileName();
46 46
         $exclusionPolicy = isset($config['exclusion_policy']) ? strtoupper($config['exclusion_policy']) : 'NONE';
47
-        $excludeAll = isset($config['exclude']) ? (Boolean)$config['exclude'] : false;
47
+        $excludeAll = isset($config['exclude']) ? (Boolean) $config['exclude'] : false;
48 48
         $classAccessType = isset($config['access_type']) ? $config['access_type'] : PropertyMetadata::ACCESS_TYPE_PROPERTY;
49
-        $readOnlyClass = isset($config['read_only']) ? (Boolean)$config['read_only'] : false;
49
+        $readOnlyClass = isset($config['read_only']) ? (Boolean) $config['read_only'] : false;
50 50
         $this->addClassProperties($metadata, $config);
51 51
 
52 52
         $propertiesMetadata = array();
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 
59 59
                 } else {
60 60
 
61
-                    if (!$class->hasMethod($methodName)) {
62
-                        throw new RuntimeException('The method ' . $methodName . ' not found in class ' . $class->name);
61
+                    if ( ! $class->hasMethod($methodName)) {
62
+                        throw new RuntimeException('The method '.$methodName.' not found in class '.$class->name);
63 63
                     }
64 64
                     $virtualPropertyMetadata = new VirtualPropertyMetadata($name, $methodName);
65 65
                 }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             }
69 69
         }
70 70
 
71
-        if (!$excludeAll) {
71
+        if ( ! $excludeAll) {
72 72
             foreach ($class->getProperties() as $property) {
73 73
                 if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) {
74 74
                     continue;
@@ -88,39 +88,39 @@  discard block
 block discarded – undo
88 88
                     $pConfig = $config['properties'][$pName];
89 89
 
90 90
                     if (isset($pConfig['exclude'])) {
91
-                        $isExclude = (Boolean)$pConfig['exclude'];
91
+                        $isExclude = (Boolean) $pConfig['exclude'];
92 92
                     }
93 93
 
94 94
                     if (isset($pConfig['expose'])) {
95
-                        $isExpose = (Boolean)$pConfig['expose'];
95
+                        $isExpose = (Boolean) $pConfig['expose'];
96 96
                     }
97 97
 
98 98
                     if (isset($pConfig['skip_when_empty'])) {
99
-                        $pMetadata->skipWhenEmpty = (Boolean)$pConfig['skip_when_empty'];
99
+                        $pMetadata->skipWhenEmpty = (Boolean) $pConfig['skip_when_empty'];
100 100
                     }
101 101
 
102 102
                     if (isset($pConfig['since_version'])) {
103
-                        $pMetadata->sinceVersion = (string)$pConfig['since_version'];
103
+                        $pMetadata->sinceVersion = (string) $pConfig['since_version'];
104 104
                     }
105 105
 
106 106
                     if (isset($pConfig['until_version'])) {
107
-                        $pMetadata->untilVersion = (string)$pConfig['until_version'];
107
+                        $pMetadata->untilVersion = (string) $pConfig['until_version'];
108 108
                     }
109 109
 
110 110
                     if (isset($pConfig['exclude_if'])) {
111
-                        $pMetadata->excludeIf = (string)$pConfig['exclude_if'];
111
+                        $pMetadata->excludeIf = (string) $pConfig['exclude_if'];
112 112
                     }
113 113
 
114 114
                     if (isset($pConfig['expose_if'])) {
115
-                        $pMetadata->excludeIf = "!(" . $pConfig['expose_if'] . ")";
115
+                        $pMetadata->excludeIf = "!(".$pConfig['expose_if'].")";
116 116
                     }
117 117
 
118 118
                     if (isset($pConfig['serialized_name'])) {
119
-                        $pMetadata->serializedName = (string)$pConfig['serialized_name'];
119
+                        $pMetadata->serializedName = (string) $pConfig['serialized_name'];
120 120
                     }
121 121
 
122 122
                     if (isset($pConfig['type'])) {
123
-                        $pMetadata->setType((string)$pConfig['type']);
123
+                        $pMetadata->setType((string) $pConfig['type']);
124 124
                     }
125 125
 
126 126
                     if (isset($pConfig['groups'])) {
@@ -132,21 +132,21 @@  discard block
 block discarded – undo
132 132
 
133 133
                         $colConfig = $pConfig['xml_list'];
134 134
                         if (isset($colConfig['inline'])) {
135
-                            $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline'];
135
+                            $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline'];
136 136
                         }
137 137
 
138 138
                         if (isset($colConfig['entry_name'])) {
139
-                            $pMetadata->xmlEntryName = (string)$colConfig['entry_name'];
139
+                            $pMetadata->xmlEntryName = (string) $colConfig['entry_name'];
140 140
                         }
141 141
 
142 142
                         if (isset($colConfig['skip_when_empty'])) {
143
-                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean)$colConfig['skip_when_empty'];
143
+                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean) $colConfig['skip_when_empty'];
144 144
                         } else {
145 145
                             $pMetadata->xmlCollectionSkipWhenEmpty = true;
146 146
                         }
147 147
 
148 148
                         if (isset($colConfig['namespace'])) {
149
-                            $pMetadata->xmlEntryNamespace = (string)$colConfig['namespace'];
149
+                            $pMetadata->xmlEntryNamespace = (string) $colConfig['namespace'];
150 150
                         }
151 151
                     }
152 152
 
@@ -155,15 +155,15 @@  discard block
 block discarded – undo
155 155
 
156 156
                         $colConfig = $pConfig['xml_map'];
157 157
                         if (isset($colConfig['inline'])) {
158
-                            $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline'];
158
+                            $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline'];
159 159
                         }
160 160
 
161 161
                         if (isset($colConfig['entry_name'])) {
162
-                            $pMetadata->xmlEntryName = (string)$colConfig['entry_name'];
162
+                            $pMetadata->xmlEntryName = (string) $colConfig['entry_name'];
163 163
                         }
164 164
 
165 165
                         if (isset($colConfig['namespace'])) {
166
-                            $pMetadata->xmlEntryNamespace = (string)$colConfig['namespace'];
166
+                            $pMetadata->xmlEntryNamespace = (string) $colConfig['namespace'];
167 167
                         }
168 168
 
169 169
                         if (isset($colConfig['key_attribute_name'])) {
@@ -175,33 +175,33 @@  discard block
 block discarded – undo
175 175
                     if (isset($pConfig['xml_element'])) {
176 176
                         $colConfig = $pConfig['xml_element'];
177 177
                         if (isset($colConfig['cdata'])) {
178
-                            $pMetadata->xmlElementCData = (Boolean)$colConfig['cdata'];
178
+                            $pMetadata->xmlElementCData = (Boolean) $colConfig['cdata'];
179 179
                         }
180 180
 
181 181
                         if (isset($colConfig['namespace'])) {
182
-                            $pMetadata->xmlNamespace = (string)$colConfig['namespace'];
182
+                            $pMetadata->xmlNamespace = (string) $colConfig['namespace'];
183 183
                         }
184 184
                     }
185 185
 
186 186
                     if (isset($pConfig['xml_attribute'])) {
187
-                        $pMetadata->xmlAttribute = (Boolean)$pConfig['xml_attribute'];
187
+                        $pMetadata->xmlAttribute = (Boolean) $pConfig['xml_attribute'];
188 188
                     }
189 189
 
190 190
                     if (isset($pConfig['xml_attribute_map'])) {
191
-                        $pMetadata->xmlAttributeMap = (Boolean)$pConfig['xml_attribute_map'];
191
+                        $pMetadata->xmlAttributeMap = (Boolean) $pConfig['xml_attribute_map'];
192 192
                     }
193 193
 
194 194
                     if (isset($pConfig['xml_value'])) {
195
-                        $pMetadata->xmlValue = (Boolean)$pConfig['xml_value'];
195
+                        $pMetadata->xmlValue = (Boolean) $pConfig['xml_value'];
196 196
                     }
197 197
 
198 198
                     if (isset($pConfig['xml_key_value_pairs'])) {
199
-                        $pMetadata->xmlKeyValuePairs = (Boolean)$pConfig['xml_key_value_pairs'];
199
+                        $pMetadata->xmlKeyValuePairs = (Boolean) $pConfig['xml_key_value_pairs'];
200 200
                     }
201 201
 
202 202
                     //we need read_only before setter and getter set, because that method depends on flag being set
203 203
                     if (isset($pConfig['read_only'])) {
204
-                        $pMetadata->readOnly = (Boolean)$pConfig['read_only'];
204
+                        $pMetadata->readOnly = (Boolean) $pConfig['read_only'];
205 205
                     } else {
206 206
                         $pMetadata->readOnly = $pMetadata->readOnly || $readOnlyClass;
207 207
                     }
@@ -213,14 +213,14 @@  discard block
 block discarded – undo
213 213
                     );
214 214
 
215 215
                     if (isset($pConfig['inline'])) {
216
-                        $pMetadata->inline = (Boolean)$pConfig['inline'];
216
+                        $pMetadata->inline = (Boolean) $pConfig['inline'];
217 217
                     }
218 218
 
219 219
                     if (isset($pConfig['max_depth'])) {
220
-                        $pMetadata->maxDepth = (int)$pConfig['max_depth'];
220
+                        $pMetadata->maxDepth = (int) $pConfig['max_depth'];
221 221
                     }
222 222
                 }
223
-                if ((ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude)
223
+                if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude)
224 224
                     || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose)
225 225
                 ) {
226 226
                     $metadata->addPropertyMetadata($pMetadata);
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
     private function addClassProperties(ClassMetadata $metadata, array $config)
263 263
     {
264
-        if (isset($config['custom_accessor_order']) && !isset($config['accessor_order'])) {
264
+        if (isset($config['custom_accessor_order']) && ! isset($config['accessor_order'])) {
265 265
             $config['accessor_order'] = 'custom';
266 266
         }
267 267
 
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
         }
271 271
 
272 272
         if (isset($config['xml_root_name'])) {
273
-            $metadata->xmlRootName = (string)$config['xml_root_name'];
273
+            $metadata->xmlRootName = (string) $config['xml_root_name'];
274 274
         }
275 275
 
276 276
         if (isset($config['xml_root_namespace'])) {
277
-            $metadata->xmlRootNamespace = (string)$config['xml_root_namespace'];
277
+            $metadata->xmlRootNamespace = (string) $config['xml_root_namespace'];
278 278
         }
279 279
 
280 280
         if (array_key_exists('xml_namespaces', $config)) {
@@ -289,25 +289,25 @@  discard block
 block discarded – undo
289 289
             if (isset($config['discriminator']['disabled']) && true === $config['discriminator']['disabled']) {
290 290
                 $metadata->discriminatorDisabled = true;
291 291
             } else {
292
-                if (!isset($config['discriminator']['field_name'])) {
292
+                if ( ! isset($config['discriminator']['field_name'])) {
293 293
                     throw new RuntimeException('The "field_name" attribute must be set for discriminators.');
294 294
                 }
295 295
 
296
-                if (!isset($config['discriminator']['map']) || !is_array($config['discriminator']['map'])) {
296
+                if ( ! isset($config['discriminator']['map']) || ! is_array($config['discriminator']['map'])) {
297 297
                     throw new RuntimeException('The "map" attribute must be set, and be an array for discriminators.');
298 298
                 }
299 299
                 $groups = isset($config['discriminator']['groups']) ? $config['discriminator']['groups'] : array();
300 300
                 $metadata->setDiscriminator($config['discriminator']['field_name'], $config['discriminator']['map'], $groups);
301 301
 
302 302
                 if (isset($config['discriminator']['xml_attribute'])) {
303
-                    $metadata->xmlDiscriminatorAttribute = (bool)$config['discriminator']['xml_attribute'];
303
+                    $metadata->xmlDiscriminatorAttribute = (bool) $config['discriminator']['xml_attribute'];
304 304
                 }
305 305
                 if (isset($config['discriminator']['xml_element'])) {
306 306
                     if (isset($config['discriminator']['xml_element']['cdata'])) {
307
-                        $metadata->xmlDiscriminatorCData = (bool)$config['discriminator']['xml_element']['cdata'];
307
+                        $metadata->xmlDiscriminatorCData = (bool) $config['discriminator']['xml_element']['cdata'];
308 308
                     }
309 309
                     if (isset($config['discriminator']['xml_element']['namespace'])) {
310
-                        $metadata->xmlDiscriminatorNamespace = (string)$config['discriminator']['xml_element']['namespace'];
310
+                        $metadata->xmlDiscriminatorNamespace = (string) $config['discriminator']['xml_element']['namespace'];
311 311
                     }
312 312
                 }
313 313
 
@@ -319,13 +319,13 @@  discard block
 block discarded – undo
319 319
     {
320 320
         if (is_string($config)) {
321 321
             $config = array($config);
322
-        } elseif (!is_array($config)) {
322
+        } elseif ( ! is_array($config)) {
323 323
             throw new RuntimeException(sprintf('callback methods expects a string, or an array of strings that represent method names, but got %s.', json_encode($config['pre_serialize'])));
324 324
         }
325 325
 
326 326
         $methods = array();
327 327
         foreach ($config as $name) {
328
-            if (!$class->hasMethod($name)) {
328
+            if ( ! $class->hasMethod($name)) {
329 329
                 throw new RuntimeException(sprintf('The method %s does not exist in class %s.', $name, $class->name));
330 330
             }
331 331
 
Please login to merge, or discard this patch.