Completed
Pull Request — master (#673)
by Asmir
02:59
created
src/JMS/Serializer/Metadata/Driver/AnnotationDriver.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 namespace JMS\Serializer\Metadata\Driver;
20 20
 
21 21
 use JMS\Serializer\Annotation\Discriminator;
22
-use JMS\Serializer\Annotation\ExcludeIf;
23 22
 use JMS\Serializer\GraphNavigator;
24 23
 use JMS\Serializer\Annotation\HandlerCallback;
25 24
 use JMS\Serializer\Annotation\AccessorOrder;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@
 block discarded – undo
159 159
                     } elseif ($annot instanceof Expose) {
160 160
                         $isExpose = true;
161 161
                         if (null !== $annot->if) {
162
-                            $propertyMetadata->excludeIf = "!(" . $annot->if . ")";
162
+                            $propertyMetadata->excludeIf = "!(".$annot->if.")";
163 163
                         }
164 164
                     } elseif ($annot instanceof Exclude) {
165 165
                         if (null !== $annot->if) {
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/PropertyMetadata.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -169,13 +169,13 @@
 block discarded – undo
169 169
             $parentStr
170 170
         ) = $unserialized;
171 171
 
172
-        if (isset($unserialized['xmlEntryNamespace'])){
172
+        if (isset($unserialized['xmlEntryNamespace'])) {
173 173
             $this->xmlEntryNamespace = $unserialized['xmlEntryNamespace'];
174 174
         }
175
-        if (isset($unserialized['xmlCollectionSkipWhenEmpty'])){
175
+        if (isset($unserialized['xmlCollectionSkipWhenEmpty'])) {
176 176
             $this->xmlCollectionSkipWhenEmpty = $unserialized['xmlCollectionSkipWhenEmpty'];
177 177
         }
178
-        if (isset($unserialized['excludeIf'])){
178
+        if (isset($unserialized['excludeIf'])) {
179 179
             $this->excludeIf = $unserialized['excludeIf'];
180 180
         }
181 181
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -169,13 +169,13 @@
 block discarded – undo
169 169
             $parentStr
170 170
         ) = $unserialized;
171 171
 
172
-        if (isset($unserialized['xmlEntryNamespace'])){
172
+        if (isset($unserialized['xmlEntryNamespace'])) {
173 173
             $this->xmlEntryNamespace = $unserialized['xmlEntryNamespace'];
174 174
         }
175
-        if (isset($unserialized['xmlCollectionSkipWhenEmpty'])){
175
+        if (isset($unserialized['xmlCollectionSkipWhenEmpty'])) {
176 176
             $this->xmlCollectionSkipWhenEmpty = $unserialized['xmlCollectionSkipWhenEmpty'];
177 177
         }
178
-        if (isset($unserialized['excludeIf'])){
178
+        if (isset($unserialized['excludeIf'])) {
179 179
             $this->excludeIf = $unserialized['excludeIf'];
180 180
         }
181 181
 
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/VirtualPropertyMetadata.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
             $this->name
101 101
         ) = $unserialized;
102 102
 
103
-        if (isset($unserialized['excludeIf'])){
103
+        if (isset($unserialized['excludeIf'])) {
104 104
             $this->excludeIf = $unserialized['excludeIf'];
105 105
         }
106 106
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
             $this->name
101 101
         ) = $unserialized;
102 102
 
103
-        if (isset($unserialized['excludeIf'])){
103
+        if (isset($unserialized['excludeIf'])) {
104 104
             $this->excludeIf = $unserialized['excludeIf'];
105 105
         }
106 106
     }
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/Driver/XmlDriver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,11 +140,11 @@
 block discarded – undo
140 140
                     }
141 141
 
142 142
                     if (null !== $excludeIf = $pElem->attributes()->{'exclude-if'}) {
143
-                        $pMetadata->excludeIf =$excludeIf;
143
+                        $pMetadata->excludeIf = $excludeIf;
144 144
                     }
145 145
 
146 146
                     if (null !== $excludeIf = $pElem->attributes()->{'expose-if'}) {
147
-                        $pMetadata->excludeIf = "!(" . $excludeIf .")";
147
+                        $pMetadata->excludeIf = "!(".$excludeIf.")";
148 148
                         $isExpose = true;
149 149
                     }
150 150
 
Please login to merge, or discard this patch.
src/JMS/Serializer/Metadata/Driver/YamlDriver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                     }
102 102
 
103 103
                     if (isset($pConfig['expose_if'])) {
104
-                        $pMetadata->excludeIf = "!(" . $pConfig['expose_if'].")";
104
+                        $pMetadata->excludeIf = "!(".$pConfig['expose_if'].")";
105 105
                     }
106 106
 
107 107
                     if (isset($pConfig['serialized_name'])) {
@@ -121,15 +121,15 @@  discard block
 block discarded – undo
121 121
 
122 122
                         $colConfig = $pConfig['xml_list'];
123 123
                         if (isset($colConfig['inline'])) {
124
-                            $pMetadata->xmlCollectionInline = (Boolean)$colConfig['inline'];
124
+                            $pMetadata->xmlCollectionInline = (Boolean) $colConfig['inline'];
125 125
                         }
126 126
 
127 127
                         if (isset($colConfig['entry_name'])) {
128
-                            $pMetadata->xmlEntryName = (string)$colConfig['entry_name'];
128
+                            $pMetadata->xmlEntryName = (string) $colConfig['entry_name'];
129 129
                         }
130 130
 
131 131
                         if (isset($colConfig['skip_when_empty'])) {
132
-                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean)$colConfig['skip_when_empty'];
132
+                            $pMetadata->xmlCollectionSkipWhenEmpty = (Boolean) $colConfig['skip_when_empty'];
133 133
                         } else {
134 134
                             $pMetadata->xmlCollectionSkipWhenEmpty = true;
135 135
                         }
Please login to merge, or discard this patch.
src/JMS/Serializer/Context.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
 
111 111
     /**
112 112
      * @param string $class
113
-     * @return bool
113
+     * @return string|boolean
114 114
      */
115 115
     public function hasExclusionStrategy($class)
116 116
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             $strategies[] = $this->exclusionStrategy;
123 123
         }
124 124
 
125
-        while (count($strategies)>0) {
125
+        while (count($strategies) > 0) {
126 126
             $strategy = array_shift($strategies);
127 127
 
128 128
             if ($strategy instanceof $class) {
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      */
290 290
     public function getCurrentPath()
291 291
     {
292
-        if (!$this->metadataStack) {
292
+        if ( ! $this->metadataStack) {
293 293
             return array();
294 294
         }
295 295
 
Please login to merge, or discard this patch.
src/JMS/Serializer/GraphNavigator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@
 block discarded – undo
190 190
                 /** @var $metadata ClassMetadata */
191 191
                 $metadata = $this->metadataFactory->getMetadataForClass($type['name']);
192 192
 
193
-                if ($metadata->usingExpression && !$context->hasExclusionStrategy(ExpressionLanguageExclusionStrategy::class)) {
193
+                if ($metadata->usingExpression && ! $context->hasExclusionStrategy(ExpressionLanguageExclusionStrategy::class)) {
194 194
                     throw new ExpressionLanguageRequiredException("To use conditional exclude/expose you must activate the ExpressionLanguageExclusionStrategy exclusion strategy");
195 195
                 }
196 196
 
Please login to merge, or discard this patch.