@@ -63,7 +63,7 @@ discard block |
||
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 |
||
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 |
@@ -209,7 +209,7 @@ |
||
209 | 209 | { |
210 | 210 | return preg_replace_callback( |
211 | 211 | '@\_([a-z]{1,1})@', |
212 | - function ($matches) { |
|
212 | + function($matches) { |
|
213 | 213 | return strtoupper($matches[1] ?? ''); |
214 | 214 | }, |
215 | 215 | $methodName |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $dataProvider = $this->parseDataProvider($xmlDataProvider); |
38 | 38 | |
39 | 39 | foreach ($xmlDataProvider->DataElement as $element) { |
40 | - $fieldName = (string)$element->attributes()['name']; |
|
40 | + $fieldName = (string) $element->attributes()['name']; |
|
41 | 41 | |
42 | 42 | if (isset($this->mergedXml[$dataProvider]['elements'][$fieldName])) { |
43 | 43 | $this->mergedXml[$dataProvider]['elements'][$fieldName] = array_merge( |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | */ |
70 | 70 | private function parseDataProvider(\SimpleXMLElement $xmlDataProvider): string |
71 | 71 | { |
72 | - $dataProvider = (string)$xmlDataProvider->attributes()['name']; |
|
72 | + $dataProvider = (string) $xmlDataProvider->attributes()['name']; |
|
73 | 73 | if (!isset($this->mergedXml[$dataProvider])) { |
74 | 74 | $this->mergedXml[$dataProvider] = [ |
75 | 75 | 'configs' => [ |
76 | - 'convertUnderlines' => (bool)$xmlDataProvider->attributes()['ConvertUnderlines'] ?? false, |
|
77 | - 'deprecated' => (bool)$xmlDataProvider->attributes()['deprecated'] ?? false |
|
76 | + 'convertUnderlines' => (bool) $xmlDataProvider->attributes()['ConvertUnderlines'] ?? false, |
|
77 | + 'deprecated' => (bool) $xmlDataProvider->attributes()['deprecated'] ?? false |
|
78 | 78 | ], |
79 | 79 | 'elements' => [] |
80 | 80 | ]; |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | */ |
91 | 91 | private function getElementData(\SimpleXMLElement $element, array $dataProvider): array |
92 | 92 | { |
93 | - $type = (string)$element->attributes()['type']; |
|
93 | + $type = (string) $element->attributes()['type']; |
|
94 | 94 | |
95 | 95 | $type = ($type !== 'double') ? $type : 'float'; |
96 | 96 | |
97 | - $allowNull = (bool)$element->attributes()['allownull']; |
|
98 | - $default = (string)$element->attributes()['default']; |
|
97 | + $allowNull = (bool) $element->attributes()['allownull']; |
|
98 | + $default = (string) $element->attributes()['default']; |
|
99 | 99 | |
100 | 100 | if ($type === 'object') { |
101 | 101 | $allowNull = true; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | $data = [ |
106 | - 'name' => (string)$element->attributes()['name'], |
|
106 | + 'name' => (string) $element->attributes()['name'], |
|
107 | 107 | 'allownull' => $allowNull, |
108 | 108 | 'default' => $default, |
109 | 109 | 'type' => $this->getVariableType($type), |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | 'isCamelCase' => $dataProvider['configs']['convertUnderlines'] |
113 | 113 | ]; |
114 | 114 | |
115 | - $singleton = (string)$element->attributes()['singleton']; |
|
115 | + $singleton = (string) $element->attributes()['singleton']; |
|
116 | 116 | if ($singleton !== '') { |
117 | - $data['singleton'] = (string)$element->attributes()['singleton']; |
|
117 | + $data['singleton'] = (string) $element->attributes()['singleton']; |
|
118 | 118 | $data['singleton_type'] = $this->getSingleVariableType($type); |
119 | 119 | } |
120 | 120 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | { |
175 | 175 | if (!$this->isSimpleType($type)) { |
176 | 176 | $namespace = ltrim($this->namespace, '\\'); |
177 | - $type = '\\' . $namespace .'\\' . $type . 'DataProvider'; |
|
177 | + $type = '\\' . $namespace . '\\' . $type . 'DataProvider'; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | if ($type === 'DataProviderInterface') { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | { |
202 | 202 | if (!$this->isSimpleType($type)) { |
203 | 203 | $namespace = ltrim($this->namespace, '\\'); |
204 | - $type = '\\' . $namespace .'\\' . $type . 'DataProvider'; |
|
204 | + $type = '\\' . $namespace . '\\' . $type . 'DataProvider'; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | if ($type === 'DataProviderInterface') { |