Completed
Pull Request — master (#884)
by Robert
13:50
created
src/JMS/Serializer/Accessor/Guess/DefaultAccessorFinder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     private function findAccessor($prefix, $property, \ReflectionClass $class)
33 33
     {
34
-        $method = $prefix . $this->toStudyCase($property);
34
+        $method = $prefix.$this->toStudyCase($property);
35 35
 
36 36
         return $class->hasMethod($method) ? $method : null;
37 37
     }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     private function toStudyCase($value)
44 44
     {
45 45
         // "foo-bar_baz" -> "fooBarBaz":
46
-        $value = \preg_replace_callback('/[\-\_](?<letter>\w)/', function (array $matches) {
46
+        $value = \preg_replace_callback('/[\-\_](?<letter>\w)/', function(array $matches) {
47 47
             return strtoupper($matches['letter']);
48 48
         }, $value);
49 49
 
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/Driver/AnnotationDriver.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
             } elseif ($annot instanceof AccessorFinder) {
92 92
                 $accessorFinder = $annot->class;
93 93
                 $accessorFinder = new $accessorFinder();
94
-                if (!$accessorFinder instanceof AccessorFinderInterface) {
95
-                    throw new LogicException('Wrong accessor finder type for class: ' . $class->name);
94
+                if ( ! $accessorFinder instanceof AccessorFinderInterface) {
95
+                    throw new LogicException('Wrong accessor finder type for class: '.$class->name);
96 96
                 }
97 97
             } elseif ($annot instanceof XmlRoot) {
98 98
                 $classMetadata->xmlRootName = $annot->name;
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
                     $classMetadata->setDiscriminator($annot->field, $annot->map, $annot->groups);
115 115
                 }
116 116
             } elseif ($annot instanceof XmlDiscriminator) {
117
-                $classMetadata->xmlDiscriminatorAttribute = (bool)$annot->attribute;
118
-                $classMetadata->xmlDiscriminatorCData = (bool)$annot->cdata;
119
-                $classMetadata->xmlDiscriminatorNamespace = $annot->namespace ? (string)$annot->namespace : null;
117
+                $classMetadata->xmlDiscriminatorAttribute = (bool) $annot->attribute;
118
+                $classMetadata->xmlDiscriminatorCData = (bool) $annot->cdata;
119
+                $classMetadata->xmlDiscriminatorNamespace = $annot->namespace ? (string) $annot->namespace : null;
120 120
             } elseif ($annot instanceof VirtualProperty) {
121 121
                 $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, $annot->name, $annot->exp);
122 122
                 $propertiesMetadata[] = $virtualPropertyMetadata;
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             }
154 154
         }
155 155
 
156
-        if (!$excludeAll) {
156
+        if ( ! $excludeAll) {
157 157
             foreach ($class->getProperties() as $property) {
158 158
                 if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) {
159 159
                     continue;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                     } elseif ($annot instanceof Expose) {
185 185
                         $isExpose = true;
186 186
                         if (null !== $annot->if) {
187
-                            $propertyMetadata->excludeIf = "!(" . $annot->if . ")";
187
+                            $propertyMetadata->excludeIf = "!(".$annot->if.")";
188 188
                         }
189 189
                     } elseif ($annot instanceof Exclude) {
190 190
                         if (null !== $annot->if) {
@@ -228,12 +228,12 @@  discard block
 block discarded – undo
228 228
                         $accessor = array($annot->getter, $annot->setter);
229 229
                     } elseif ($annot instanceof Groups) {
230 230
                         $propertyMetadata->groups = $annot->groups;
231
-                        foreach ((array)$propertyMetadata->groups as $groupName) {
231
+                        foreach ((array) $propertyMetadata->groups as $groupName) {
232 232
                             if (false !== strpos($groupName, ',')) {
233 233
                                 throw new InvalidArgumentException(sprintf(
234 234
                                     'Invalid group name "%s" on "%s", did you mean to create multiple groups?',
235 235
                                     implode(', ', $propertyMetadata->groups),
236
-                                    $propertyMetadata->class . '->' . $propertyMetadata->name
236
+                                    $propertyMetadata->class.'->'.$propertyMetadata->name
237 237
                                 ));
238 238
                             }
239 239
                         }
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
                 }
248 248
 
249 249
 
250
-                if ((ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude)
250
+                if ((ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude)
251 251
                     || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose)
252 252
                 ) {
253 253
                     if ($accessorFinder) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -280,8 +280,7 @@
 block discarded – undo
280 280
         array $accessor,
281 281
         \ReflectionClass $class,
282 282
         PropertyMetadata $metadata
283
-    )
284
-    {
283
+    ) {
285 284
         list($getter, $setter) = $accessor;
286 285
 
287 286
         if ($getter === null) {
Please login to merge, or discard this patch.