Passed
Push — master ( 5ddf32...f0520f )
by Mike
02:13
created
src/Xervice/DataProvider/Business/Model/Generator/DataProviderGenerator.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -152,8 +152,7 @@  discard block
 block discarded – undo
152 152
         if ($element['default']) {
153 153
             $default = $this->getDefaultValue($element);
154 154
             $param->setDefaultValue($default);
155
-        }
156
-        elseif ($element['allownull']) {
155
+        } elseif ($element['allownull']) {
157 156
             $param->setDefaultValue(null);
158 157
         }
159 158
     }
@@ -199,8 +198,7 @@  discard block
 block discarded – undo
199 198
         if ($element['default']) {
200 199
             $default = $this->getDefaultValue($element);
201 200
             $property->setValue($default);
202
-        }
203
-        elseif (strpos($element['type'], '[]') !== false) {
201
+        } elseif (strpos($element['type'], '[]') !== false) {
204 202
             $property->setValue([]);
205 203
         }
206 204
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         foreach ($this->parser->getDataProvider() as $providerName => $providerData) {
64 64
             $namespace = new PhpNamespace($this->namespace);
65 65
             $dataProvider = $this->createDataProviderClass($providerName, $providerData, $namespace);
66
-            $classContent = (string)$namespace;
66
+            $classContent = (string) $namespace;
67 67
             $classContent = str_replace('\?', '?', $classContent);
68 68
             $classContent = Helpers::tabsToSpaces($classContent, 4);
69 69
             $this->fileWriter->writeToFile($dataProvider->getName() . '.php', $classContent);
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
     {
352 352
         return preg_replace_callback(
353 353
             '@\_([a-z]{1,1})@',
354
-            function ($matches) {
354
+            function($matches) {
355 355
                 return strtoupper($matches[1] ?? '');
356 356
             },
357 357
             $methodName
Please login to merge, or discard this patch.
Xervice/DataProvider/Business/Model/DataProvider/AbstractDataProvider.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -58,17 +58,13 @@  discard block
 block discarded – undo
58 58
     {
59 59
         if (strpos($element['type'], 'DataProviderInterface[]') !== false) {
60 60
             $this->setChildData($data, $fieldname);
61
-        }
62
-        elseif (strpos($element['type'], 'DataProviderInterface') !== false) {
61
+        } elseif (strpos($element['type'], 'DataProviderInterface') !== false) {
63 62
             $this->setAnyDataProviderValues($data, $fieldname);
64
-        }
65
-        elseif ($element['is_dataprovider']) {
63
+        } elseif ($element['is_dataprovider']) {
66 64
             $this->setOneDataProviderValue($data, $element, $fieldname);
67
-        }
68
-        elseif ($element['is_collection']) {
65
+        } elseif ($element['is_collection']) {
69 66
             $this->setCollectionValues($data, $element, $fieldname);
70
-        }
71
-        else {
67
+        } else {
72 68
             $this->{$fieldname} = $data[$fieldname];
73 69
         }
74 70
     }
@@ -86,21 +82,17 @@  discard block
 block discarded – undo
86 82
         $getMethod = 'get' . $fieldname;
87 83
         if (strpos($element['type'], 'DataProviderInterface[]') !== false) {
88 84
             $data = $this->getDataProviderCollectionData($provider, $fieldname, $data, $getMethod);
89
-        }
90
-        elseif (
85
+        } elseif (
91 86
             strpos($element['type'], 'DataProviderInterface') !== false
92 87
             && $provider->{$getMethod}() instanceof DataProviderInterface
93 88
         ) {
94 89
             $anyDataProvider = new AnyDataProvider($provider->{$getMethod}());
95 90
             $data[$fieldname] = $anyDataProvider->toArray();
96
-        }
97
-        elseif ($element['is_dataprovider'] && $provider->{$getMethod}() instanceof DataProviderInterface) {
91
+        } elseif ($element['is_dataprovider'] && $provider->{$getMethod}() instanceof DataProviderInterface) {
98 92
             $data[$fieldname] = $this->convertToArray($provider->{$getMethod}());
99
-        }
100
-        elseif ($element['is_collection']) {
93
+        } elseif ($element['is_collection']) {
101 94
             $data = $this->getCollectionData($provider, $fieldname, $data, $getMethod);
102
-        }
103
-        else {
95
+        } else {
104 96
             $data[$fieldname] = $provider->{$getMethod}();
105 97
         }
106 98
         return $data;
Please login to merge, or discard this patch.
src/Xervice/DataProvider/Business/Model/Parser/XmlMerger.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
             $dataProvider = $this->parseDataProvider($xmlDataProvider);
26 26
 
27 27
             foreach ($xmlDataProvider->DataElement as $element) {
28
-                $fieldName = (string)$element->attributes()['name'];
28
+                $fieldName = (string) $element->attributes()['name'];
29 29
 
30 30
                 if (isset($this->mergedXml[$dataProvider]['elements'][$fieldName])) {
31 31
                     $this->mergedXml[$dataProvider]['elements'][$fieldName] = array_merge(
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
      */
57 57
     private function parseDataProvider(\SimpleXMLElement $xmlDataProvider): string
58 58
     {
59
-        $dataProvider = (string)$xmlDataProvider->attributes()['name'];
59
+        $dataProvider = (string) $xmlDataProvider->attributes()['name'];
60 60
         if (!isset($this->mergedXml[$dataProvider])) {
61 61
             $this->mergedXml[$dataProvider] = [
62 62
                 'configs' => [
63
-                   'convertUnderlines' => (bool)$xmlDataProvider->attributes()['ConvertUnderlines'] ?? false,
64
-                   'deprecated' => (bool)$xmlDataProvider->attributes()['deprecated'] ?? false
63
+                   'convertUnderlines' => (bool) $xmlDataProvider->attributes()['ConvertUnderlines'] ?? false,
64
+                   'deprecated' => (bool) $xmlDataProvider->attributes()['deprecated'] ?? false
65 65
                 ],
66 66
                 'elements' => []
67 67
             ];
@@ -77,20 +77,20 @@  discard block
 block discarded – undo
77 77
      */
78 78
     private function getElementData(\SimpleXMLElement $element): array
79 79
     {
80
-        $type = (string)$element->attributes()['type'];
80
+        $type = (string) $element->attributes()['type'];
81 81
 
82 82
         $data = [
83
-            'name'      => (string)$element->attributes()['name'],
84
-            'allownull'      => (bool)$element->attributes()['allownull'],
85
-            'default'      => (string)$element->attributes()['default'],
83
+            'name'      => (string) $element->attributes()['name'],
84
+            'allownull'      => (bool) $element->attributes()['allownull'],
85
+            'default'      => (string) $element->attributes()['default'],
86 86
             'type'      => $this->getVariableType($type),
87 87
             'is_collection'  => $this->isCollection($type),
88 88
             'is_dataprovider' => $this->isDataProvider($type)
89 89
         ];
90 90
 
91
-        $singleton = (string)$element->attributes()['singleton'];
91
+        $singleton = (string) $element->attributes()['singleton'];
92 92
         if ($singleton !== '') {
93
-            $data['singleton'] = (string)$element->attributes()['singleton'];
93
+            $data['singleton'] = (string) $element->attributes()['singleton'];
94 94
             $data['singleton_type'] = $this->getSingleVariableType($type);
95 95
         }
96 96
 
Please login to merge, or discard this patch.