Completed
Pull Request — master (#844)
by Christian
05:04
created
src/JMS/Serializer/Context.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
     private function assertMutable()
116 116
     {
117
-        if (!$this->initialized) {
117
+        if ( ! $this->initialized) {
118 118
             return;
119 119
         }
120 120
 
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
             throw new \LogicException('The groups must not be empty.');
170 170
         }
171 171
 
172
-        $this->attributes->set('groups', (array)$groups);
173
-        $this->addExclusionStrategy(new GroupsExclusionStrategy((array)$groups));
172
+        $this->attributes->set('groups', (array) $groups);
173
+        $this->addExclusionStrategy(new GroupsExclusionStrategy((array) $groups));
174 174
 
175 175
         return $this;
176 176
     }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      */
191 191
     public function setSerializeNull($bool)
192 192
     {
193
-        $this->serializeNull = (boolean)$bool;
193
+        $this->serializeNull = (boolean) $bool;
194 194
 
195 195
         return $this;
196 196
     }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     {
231 231
         $metadata = $this->metadataStack->pop();
232 232
 
233
-        if (!$metadata instanceof PropertyMetadata) {
233
+        if ( ! $metadata instanceof PropertyMetadata) {
234 234
             throw new RuntimeException('Context metadataStack not working well');
235 235
         }
236 236
     }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     {
240 240
         $metadata = $this->metadataStack->pop();
241 241
 
242
-        if (!$metadata instanceof ClassMetadata) {
242
+        if ( ! $metadata instanceof ClassMetadata) {
243 243
             throw new RuntimeException('Context metadataStack not working well');
244 244
         }
245 245
     }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      */
255 255
     public function getCurrentPath()
256 256
     {
257
-        if (!$this->metadataStack) {
257
+        if ( ! $this->metadataStack) {
258 258
             return array();
259 259
         }
260 260
 
Please login to merge, or discard this patch.
src/JMS/Serializer/Construction/DoctrineObjectConstructor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         // Locate possible ObjectManager
52 52
         $objectManager = $this->managerRegistry->getManagerForClass($metadata->name);
53 53
 
54
-        if (!$objectManager) {
54
+        if ( ! $objectManager) {
55 55
             // No ObjectManager found, proceed with normal deserialization
56 56
             return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
57 57
         }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         }
66 66
 
67 67
         // Managed entity, check for proxy load
68
-        if (!is_array($data)) {
68
+        if ( ! is_array($data)) {
69 69
             // Single identifier, load proxy
70 70
             return $objectManager->getReference($metadata->name, $data);
71 71
         }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         $identifierList = array();
76 76
 
77 77
         foreach ($classMetadata->getIdentifierFieldNames() as $name) {
78
-            if (!array_key_exists($name, $data)) {
78
+            if ( ! array_key_exists($name, $data)) {
79 79
                 return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
80 80
             }
81 81
 
Please login to merge, or discard this patch.
src/JMS/Serializer/Handler/FormErrorHandler.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
     private function getErrorMessage(FormError $error)
123 123
     {
124 124
 
125
-        if ($this->translator === null){
125
+        if ($this->translator === null) {
126 126
             return $error->getMessage();
127 127
         }
128 128
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
     private function getErrorMessage(FormError $error)
123 123
     {
124 124
 
125
-        if ($this->translator === null){
125
+        if ($this->translator === null) {
126 126
             return $error->getMessage();
127 127
         }
128 128
 
Please login to merge, or discard this patch.
src/JMS/Serializer/EventDispatcher/LazyEventDispatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
     public function __construct($container)
29 29
     {
30
-        if (!$container instanceof PsrContainerInterface && !$container instanceof ContainerInterface) {
30
+        if ( ! $container instanceof PsrContainerInterface && ! $container instanceof ContainerInterface) {
31 31
             throw new \InvalidArgumentException(sprintf('The container must be an instance of %s or %s (%s given).', PsrContainerInterface::class, ContainerInterface::class, is_object($container) ? get_class($container) : gettype($container)));
32 32
         }
33 33
 
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
         $listeners = parent::initializeListeners($eventName, $loweredClass, $format);
43 43
 
44 44
         foreach ($listeners as &$listener) {
45
-            if (!is_array($listener) || !is_string($listener[0])) {
45
+            if ( ! is_array($listener) || ! is_string($listener[0])) {
46 46
                 continue;
47 47
             }
48 48
 
49
-            if (!$this->container->has($listener[0])) {
49
+            if ( ! $this->container->has($listener[0])) {
50 50
                 continue;
51 51
             }
52 52
 
Please login to merge, or discard this patch.