Completed
Pull Request — master (#794)
by Pauline
14:49
created
src/Builder/CallbackDriverFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     public function createDriver(array $metadataDirs, Reader $reader)
21 21
     {
22 22
         $driver = call_user_func($this->callback, $metadataDirs, $reader);
23
-        if (!$driver instanceof DriverInterface) {
23
+        if ( ! $driver instanceof DriverInterface) {
24 24
             throw new \LogicException('The callback must return an instance of DriverInterface.');
25 25
         }
26 26
 
Please login to merge, or discard this patch.
src/Builder/DefaultDriverFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 {
14 14
     public function createDriver(array $metadataDirs, Reader $annotationReader)
15 15
     {
16
-        if (!empty($metadataDirs)) {
16
+        if ( ! empty($metadataDirs)) {
17 17
             $fileLocator = new FileLocator($metadataDirs);
18 18
 
19 19
             return new DriverChain(array(
Please login to merge, or discard this patch.
src/EventDispatcher/LazyEventDispatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,11 +37,11 @@
 block discarded – undo
37 37
         $listeners = parent::initializeListeners($eventName, $loweredClass, $format);
38 38
 
39 39
         foreach ($listeners as &$listener) {
40
-            if (!is_array($listener) || !is_string($listener[0])) {
40
+            if ( ! is_array($listener) || ! is_string($listener[0])) {
41 41
                 continue;
42 42
             }
43 43
 
44
-            if (!$this->container->has($listener[0])) {
44
+            if ( ! $this->container->has($listener[0])) {
45 45
                 continue;
46 46
             }
47 47
 
Please login to merge, or discard this patch.
src/Metadata/PropertyMetadata.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -59,22 +59,22 @@
 block discarded – undo
59 59
             $class = $this->reflection->getDeclaringClass();
60 60
 
61 61
             if (empty($getter)) {
62
-                if ($class->hasMethod('get' . $this->name) && $class->getMethod('get' . $this->name)->isPublic()) {
63
-                    $getter = 'get' . $this->name;
64
-                } elseif ($class->hasMethod('is' . $this->name) && $class->getMethod('is' . $this->name)->isPublic()) {
65
-                    $getter = 'is' . $this->name;
66
-                } elseif ($class->hasMethod('has' . $this->name) && $class->getMethod('has' . $this->name)->isPublic()) {
67
-                    $getter = 'has' . $this->name;
62
+                if ($class->hasMethod('get'.$this->name) && $class->getMethod('get'.$this->name)->isPublic()) {
63
+                    $getter = 'get'.$this->name;
64
+                } elseif ($class->hasMethod('is'.$this->name) && $class->getMethod('is'.$this->name)->isPublic()) {
65
+                    $getter = 'is'.$this->name;
66
+                } elseif ($class->hasMethod('has'.$this->name) && $class->getMethod('has'.$this->name)->isPublic()) {
67
+                    $getter = 'has'.$this->name;
68 68
                 } else {
69
-                    throw new RuntimeException(sprintf('There is neither a public %s method, nor a public %s method, nor a public %s method in class %s. Please specify which public method should be used for retrieving the value of the property %s.', 'get' . ucfirst($this->name), 'is' . ucfirst($this->name), 'has' . ucfirst($this->name), $this->class, $this->name));
69
+                    throw new RuntimeException(sprintf('There is neither a public %s method, nor a public %s method, nor a public %s method in class %s. Please specify which public method should be used for retrieving the value of the property %s.', 'get'.ucfirst($this->name), 'is'.ucfirst($this->name), 'has'.ucfirst($this->name), $this->class, $this->name));
70 70
                 }
71 71
             }
72 72
 
73
-            if (empty($setter) && !$this->readOnly) {
74
-                if ($class->hasMethod('set' . $this->name) && $class->getMethod('set' . $this->name)->isPublic()) {
75
-                    $setter = 'set' . $this->name;
73
+            if (empty($setter) && ! $this->readOnly) {
74
+                if ($class->hasMethod('set'.$this->name) && $class->getMethod('set'.$this->name)->isPublic()) {
75
+                    $setter = 'set'.$this->name;
76 76
                 } else {
77
-                    throw new RuntimeException(sprintf('There is no public %s method in class %s. Please specify which public method should be used for setting the value of the property %s.', 'set' . ucfirst($this->name), $this->class, $this->name));
77
+                    throw new RuntimeException(sprintf('There is no public %s method in class %s. Please specify which public method should be used for setting the value of the property %s.', 'set'.ucfirst($this->name), $this->class, $this->name));
78 78
                 }
79 79
             }
80 80
         }
Please login to merge, or discard this patch.
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.