Completed
Pull Request — master (#786)
by Adam
05:12
created
src/Handler/ConstraintViolationHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
                     'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
41 41
                     'type' => $type,
42 42
                     'format' => $format,
43
-                    'method' => $method . 'To' . $format,
43
+                    'method' => $method.'To'.$format,
44 44
                 );
45 45
             }
46 46
         }
Please login to merge, or discard this patch.
src/Handler/DateHandler.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                     'type' => $type,
54 54
                     'format' => $format,
55 55
                     'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
56
-                    'method' => 'serialize' . $type,
56
+                    'method' => 'serialize'.$type,
57 57
                 );
58 58
             }
59 59
         }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     private function isDataXmlNull($data)
117 117
     {
118 118
         $attributes = $data->attributes('xsi', true);
119
-        return isset($attributes['nil'][0]) && (string)$attributes['nil'][0] === 'true';
119
+        return isset($attributes['nil'][0]) && (string) $attributes['nil'][0] === 'true';
120 120
     }
121 121
 
122 122
     public function deserializeDateTimeFromXml(XmlDeserializationVisitor $visitor, $data, array $type)
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
         $format = $this->getFormat($type);
180 180
 
181 181
         if ($immutable) {
182
-            $datetime = \DateTimeImmutable::createFromFormat($format, (string)$data, $timezone);
182
+            $datetime = \DateTimeImmutable::createFromFormat($format, (string) $data, $timezone);
183 183
         } else {
184
-            $datetime = \DateTime::createFromFormat($format, (string)$data, $timezone);
184
+            $datetime = \DateTime::createFromFormat($format, (string) $data, $timezone);
185 185
         }
186 186
 
187 187
         if (false === $datetime) {
@@ -221,15 +221,15 @@  discard block
 block discarded – undo
221 221
         $format = 'P';
222 222
 
223 223
         if (0 < $dateInterval->y) {
224
-            $format .= $dateInterval->y . 'Y';
224
+            $format .= $dateInterval->y.'Y';
225 225
         }
226 226
 
227 227
         if (0 < $dateInterval->m) {
228
-            $format .= $dateInterval->m . 'M';
228
+            $format .= $dateInterval->m.'M';
229 229
         }
230 230
 
231 231
         if (0 < $dateInterval->d) {
232
-            $format .= $dateInterval->d . 'D';
232
+            $format .= $dateInterval->d.'D';
233 233
         }
234 234
 
235 235
         if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) {
@@ -237,15 +237,15 @@  discard block
 block discarded – undo
237 237
         }
238 238
 
239 239
         if (0 < $dateInterval->h) {
240
-            $format .= $dateInterval->h . 'H';
240
+            $format .= $dateInterval->h.'H';
241 241
         }
242 242
 
243 243
         if (0 < $dateInterval->i) {
244
-            $format .= $dateInterval->i . 'M';
244
+            $format .= $dateInterval->i.'M';
245 245
         }
246 246
 
247 247
         if (0 < $dateInterval->s) {
248
-            $format .= $dateInterval->s . 'S';
248
+            $format .= $dateInterval->s.'S';
249 249
         }
250 250
 
251 251
         if ($format === 'P') {
Please login to merge, or discard this patch.
src/Handler/HandlerRegistry.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 
35 35
         switch ($direction) {
36 36
             case GraphNavigator::DIRECTION_DESERIALIZATION:
37
-                return 'deserialize' . $type . 'From' . $format;
37
+                return 'deserialize'.$type.'From'.$format;
38 38
 
39 39
             case GraphNavigator::DIRECTION_SERIALIZATION:
40
-                return 'serialize' . $type . 'To' . $format;
40
+                return 'serialize'.$type.'To'.$format;
41 41
 
42 42
             default:
43 43
                 throw new LogicException(sprintf('The direction %s does not exist; see GraphNavigator::DIRECTION_??? constants.', json_encode($direction)));
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     public function registerSubscribingHandler(SubscribingHandlerInterface $handler)
53 53
     {
54 54
         foreach ($handler->getSubscribingMethods() as $methodData) {
55
-            if (!isset($methodData['type'], $methodData['format'])) {
55
+            if ( ! isset($methodData['type'], $methodData['format'])) {
56 56
                 throw new RuntimeException(sprintf('For each subscribing method a "type" and "format" attribute must be given, but only got "%s" for %s.', implode('" and "', array_keys($methodData)), get_class($handler)));
57 57
             }
58 58
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
     public function getHandler($direction, $typeName, $format)
81 81
     {
82
-        if (!isset($this->handlers[$direction][$typeName][$format])) {
82
+        if ( ! isset($this->handlers[$direction][$typeName][$format])) {
83 83
             return null;
84 84
         }
85 85
 
Please login to merge, or discard this patch.
src/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/Util/Writer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function writeln($content)
63 63
     {
64
-        $this->write($content . "\n");
64
+        $this->write($content."\n");
65 65
 
66 66
         return $this;
67 67
     }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $lines = explode("\n", $content);
86 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
             ) {
91 91
                 $addition .= str_repeat(' ', $this->indentationLevel * $this->indentationSpaces);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
     public function rtrim($preserveNewLines = true)
109 109
     {
110
-        if (!$preserveNewLines) {
110
+        if ( ! $preserveNewLines) {
111 111
             $this->content = rtrim($this->content);
112 112
 
113 113
             return $this;
Please login to merge, or discard this patch.
src/SerializationContext.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     public function startVisiting($object)
51 51
     {
52
-        if (!is_object($object)) {
52
+        if ( ! is_object($object)) {
53 53
             return;
54 54
         }
55 55
         $this->visitingSet->attach($object);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
     public function stopVisiting($object)
60 60
     {
61
-        if (!is_object($object)) {
61
+        if ( ! is_object($object)) {
62 62
             return;
63 63
         }
64 64
         $this->visitingSet->detach($object);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
     public function isVisiting($object)
73 73
     {
74
-        if (!is_object($object)) {
74
+        if ( ! is_object($object)) {
75 75
             return false;
76 76
         }
77 77
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             $path[] = get_class($obj);
86 86
         }
87 87
 
88
-        if (!$path) {
88
+        if ( ! $path) {
89 89
             return null;
90 90
         }
91 91
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
     public function getObject()
106 106
     {
107
-        return !$this->visitingStack->isEmpty() ? $this->visitingStack->top() : null;
107
+        return ! $this->visitingStack->isEmpty() ? $this->visitingStack->top() : null;
108 108
     }
109 109
 
110 110
     public function getVisitingStack()
Please login to merge, or discard this patch.
src/TypeParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             /x',
51 51
             array(self::T_NAME => 'T_NAME', self::T_STRING => 'T_STRING', self::T_OPEN_BRACKET => 'T_OPEN_BRACKET',
52 52
                 self::T_CLOSE_BRACKET => 'T_CLOSE_BRACKET', self::T_COMMA => 'T_COMMA', self::T_NONE => 'T_NONE'),
53
-            function ($value) {
53
+            function($value) {
54 54
                 switch ($value[0]) {
55 55
                     case '"':
56 56
                     case "'":
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     protected function parseInternal()
83 83
     {
84 84
         $typeName = $this->match(self::T_NAME);
85
-        if (!$this->lexer->isNext(self::T_OPEN_BRACKET)) {
85
+        if ( ! $this->lexer->isNext(self::T_OPEN_BRACKET)) {
86 86
             return array('name' => $typeName, 'params' => array());
87 87
         }
88 88
 
Please login to merge, or discard this patch.
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.