Completed
Pull Request — master (#708)
by Asmir
04:04
created
src/JMS/Serializer/XmlSerializationVisitor.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -132,6 +132,9 @@  discard block
 block discarded – undo
132 132
         return $doCData ? $this->document->createCDATASection($data) : $this->document->createTextNode((string) $data);
133 133
     }
134 134
 
135
+    /**
136
+     * @param string $data
137
+     */
135 138
     public function visitSimpleString($data, array $type, Context $context)
136 139
     {
137 140
         if (null === $this->document) {
@@ -454,6 +457,9 @@  discard block
 block discarded – undo
454 457
         }
455 458
     }
456 459
 
460
+    /**
461
+     * @return \DOMNode
462
+     */
457 463
     private function createElement($tagName, $namespace = null)
458 464
     {
459 465
         if (null === $namespace) {
@@ -469,6 +475,9 @@  discard block
 block discarded – undo
469 475
         return $this->document->createElement($prefix . ':' . $tagName);
470 476
     }
471 477
 
478
+    /**
479
+     * @param string $value
480
+     */
472 481
     private function setAttributeOnNode(\DOMElement $node, $name, $value, $namespace = null)
473 482
     {
474 483
         if (null !== $namespace) {
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/ExpressionPropertyMetadata.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,10 +115,10 @@
 block discarded – undo
115 115
             $this->name
116 116
         ) = $unserialized;
117 117
 
118
-        if (isset($unserialized['excludeIf'])){
118
+        if (isset($unserialized['excludeIf'])) {
119 119
             $this->excludeIf = $unserialized['excludeIf'];
120 120
         }
121
-        if (isset($unserialized['expression'])){
121
+        if (isset($unserialized['expression'])) {
122 122
             $this->expression = $unserialized['expression'];
123 123
         }
124 124
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,10 +115,10 @@
 block discarded – undo
115 115
             $this->name
116 116
         ) = $unserialized;
117 117
 
118
-        if (isset($unserialized['excludeIf'])){
118
+        if (isset($unserialized['excludeIf'])) {
119 119
             $this->excludeIf = $unserialized['excludeIf'];
120 120
         }
121
-        if (isset($unserialized['expression'])){
121
+        if (isset($unserialized['expression'])) {
122 122
             $this->expression = $unserialized['expression'];
123 123
         }
124 124
     }
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/Driver/XmlDriver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         foreach ($elem->xpath('./virtual-property') as $method) {
118 118
 
119 119
             if (isset($method->attributes()->expression)) {
120
-                $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, (string)$method->attributes()->name, (string)$method->attributes()->expression);
120
+                $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, (string) $method->attributes()->name, (string) $method->attributes()->expression);
121 121
             } else {
122 122
                 if ( ! isset($method->attributes()->method)) {
123 123
                     throw new RuntimeException('The method attribute must be set for all virtual-property elements.');
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
                     }
160 160
 
161 161
                     if (null !== $excludeIf = $pElem->attributes()->{'exclude-if'}) {
162
-                        $pMetadata->excludeIf =$excludeIf;
162
+                        $pMetadata->excludeIf = $excludeIf;
163 163
                     }
164 164
 
165 165
                     if (null !== $excludeIf = $pElem->attributes()->{'expose-if'}) {
166
-                        $pMetadata->excludeIf = "!(" . $excludeIf .")";
166
+                        $pMetadata->excludeIf = "!(".$excludeIf.")";
167 167
                         $isExpose = true;
168 168
                     }
169 169
 
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/Driver/YamlDriver.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         if (array_key_exists('virtual_properties', $config)) {
54 54
             foreach ($config['virtual_properties'] as $methodName => $propertySettings) {
55 55
                 if (isset($propertySettings['exp'])) {
56
-                    $virtualPropertyMetadata = new ExpressionPropertyMetadata( $name, $methodName, $propertySettings['exp']);
56
+                    $virtualPropertyMetadata = new ExpressionPropertyMetadata($name, $methodName, $propertySettings['exp']);
57 57
                     unset($propertySettings['exp']);
58 58
 
59 59
                 } else {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                     }
108 108
 
109 109
                     if (isset($pConfig['expose_if'])) {
110
-                        $pMetadata->excludeIf = "!(" . $pConfig['expose_if'].")";
110
+                        $pMetadata->excludeIf = "!(".$pConfig['expose_if'].")";
111 111
                     }
112 112
 
113 113
                     if (isset($pConfig['serialized_name'])) {
@@ -127,15 +127,15 @@  discard block
 block discarded – undo
127 127
 
128 128
                         $colConfig = $pConfig['xml_list'];
129 129
                         if (isset($colConfig['inline'])) {
130
-                            $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline'];
130
+                            $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline'];
131 131
                         }
132 132
 
133 133
                         if (isset($colConfig['entry_name'])) {
134
-                            $pMetadata->xmlEntryName = (string)$colConfig['entry_name'];
134
+                            $pMetadata->xmlEntryName = (string) $colConfig['entry_name'];
135 135
                         }
136 136
 
137 137
                         if (isset($colConfig['skip_when_empty'])) {
138
-                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean)$colConfig['skip_when_empty'];
138
+                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean) $colConfig['skip_when_empty'];
139 139
                         } else {
140 140
                             $pMetadata->xmlCollectionSkipWhenEmpty = true;
141 141
                         }
Please login to merge, or discard this patch.
src/JMS/Serializer/SerializerBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
 
116 116
     protected function getAccessorStrategy()
117 117
     {
118
-        if (!$this->accessorStrategy) {
118
+        if ( ! $this->accessorStrategy) {
119 119
             $this->accessorStrategy = new DefaultAccessorStrategy();
120 120
 
121 121
             if ($this->expressionEvaluator) {
Please login to merge, or discard this patch.
src/JMS/Serializer/Annotation/VirtualProperty.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         }
39 39
 
40 40
         foreach ($data as $key => $value) {
41
-            if (!property_exists(__CLASS__, $key)) {
41
+            if ( ! property_exists(__CLASS__, $key)) {
42 42
                 throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, __CLASS__));
43 43
             }
44 44
             $this->{$key} = $value;
Please login to merge, or discard this patch.