@@ -110,6 +110,6 @@ |
||
110 | 110 | { |
111 | 111 | $ctype = $row['CType']; |
112 | 112 | |
113 | - return (bool) $GLOBALS['TYPO3_CONF_VARS']['AUTOLOADER']['ContentObject'][$ctype]; |
|
113 | + return (bool)$GLOBALS['TYPO3_CONF_VARS']['AUTOLOADER']['ContentObject'][$ctype]; |
|
114 | 114 | } |
115 | 115 | } |
@@ -45,8 +45,8 @@ |
||
45 | 45 | */ |
46 | 46 | protected function useTableNameFileBase() |
47 | 47 | { |
48 | - $configuration = \unserialize((string) $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['autoloader']); |
|
48 | + $configuration = \unserialize((string)$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['autoloader']); |
|
49 | 49 | |
50 | - return isset($configuration['enableLanguageFileOnTableBase']) ? (bool) $configuration['enableLanguageFileOnTableBase'] : false; |
|
50 | + return isset($configuration['enableLanguageFileOnTableBase']) ? (bool)$configuration['enableLanguageFileOnTableBase'] : false; |
|
51 | 51 | } |
52 | 52 | } |
@@ -7,13 +7,11 @@ |
||
7 | 7 | |
8 | 8 | namespace HDNET\Autoloader\Utility; |
9 | 9 | |
10 | -use HDNET\Autoloader\Hooks\ClearCache; |
|
11 | 10 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
12 | 11 | use TYPO3\CMS\Core\Utility\VersionNumberUtility; |
13 | 12 | use TYPO3\CMS\Extbase\Reflection\ClassReflection; |
14 | 13 | use TYPO3\CMS\Extbase\Reflection\MethodReflection; |
15 | 14 | use TYPO3\CMS\Extbase\Reflection\ReflectionService; |
16 | -use TYPO3\CMS\Extbase\Utility\DebuggerUtility; |
|
17 | 15 | |
18 | 16 | /** |
19 | 17 | * Reflection helper. |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @param string $className |
133 | 133 | * @param string $tag |
134 | 134 | * |
135 | - * @return string|bool |
|
135 | + * @return false|string |
|
136 | 136 | */ |
137 | 137 | public static function getFirstTagValue(string $className, string $tag) |
138 | 138 | { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * Get the tag configuration from this method and respect multiple line and space configuration. |
188 | 188 | * |
189 | 189 | * @param string $className |
190 | - * @param array $tagNames |
|
190 | + * @param string[] $tagNames |
|
191 | 191 | * |
192 | 192 | * @return array |
193 | 193 | */ |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | /** |
218 | 218 | * Get the tag configuration from this method and respect multiple line and space configuration. |
219 | 219 | * |
220 | - * @param MethodReflection|ClassReflection $reflectionObject |
|
221 | - * @param array $tagNames |
|
220 | + * @param string[] $tagNames |
|
221 | + * @param string $className |
|
222 | 222 | * |
223 | 223 | * @return array |
224 | 224 | */ |
@@ -246,8 +246,8 @@ discard block |
||
246 | 246 | /** |
247 | 247 | * Get the tag configuration from this method and respect multiple line and space configuration. |
248 | 248 | * |
249 | - * @param MethodReflection|ClassReflection $reflectionObject |
|
250 | - * @param array $tagNames |
|
249 | + * @param string[] $tagNames |
|
250 | + * @param string $className |
|
251 | 251 | * |
252 | 252 | * @return array |
253 | 253 | */ |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public static function isInstantiable($className):bool |
44 | 44 | { |
45 | - if(self::is9orHigher()) { |
|
45 | + if (self::is9orHigher()) { |
|
46 | 46 | $reflectionClass = new \ReflectionClass($className); |
47 | 47 | return (bool)$reflectionClass->isInstantiable(); |
48 | 48 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public static function getParentClassName($className) |
62 | 62 | { |
63 | - if(self::is9orHigher()) { |
|
63 | + if (self::is9orHigher()) { |
|
64 | 64 | $reflectionClass = new \ReflectionClass($className); |
65 | 65 | return $reflectionClass->getParentClass()->getName(); |
66 | 66 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $return = []; |
106 | 106 | foreach ($properties as $property) { |
107 | 107 | $config = self::getTagConfigurationForProperty($className, $property, [$tag]); |
108 | - if(!empty($config[$tag])) { |
|
108 | + if (!empty($config[$tag])) { |
|
109 | 109 | $return[] = $property; |
110 | 110 | } |
111 | 111 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public static function getFirstTagValue(string $className, string $tag) |
138 | 138 | { |
139 | - if(self::is9orHigher()) { |
|
139 | + if (self::is9orHigher()) { |
|
140 | 140 | $reflectionService = GeneralUtility::makeInstance(ReflectionService::class); |
141 | 141 | $values = $reflectionService->getClassTagValues($className, $tag); |
142 | 142 | } else { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | if (\is_array($values)) { |
151 | - return \trim((string) $values[0]); |
|
151 | + return \trim((string)$values[0]); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | return false; |
@@ -325,10 +325,10 @@ discard block |
||
325 | 325 | public static function getDeclaringProperties($className) |
326 | 326 | { |
327 | 327 | $classReflection = new \ReflectionClass($className); |
328 | - $own = array_filter($classReflection->getProperties(), function ($property) use ($className) { |
|
328 | + $own = array_filter($classReflection->getProperties(), function($property) use ($className) { |
|
329 | 329 | return $property->class == $className; |
330 | 330 | }); |
331 | - return array_map(function($item){ |
|
331 | + return array_map(function($item) { |
|
332 | 332 | return $item->name; |
333 | 333 | }, $own); |
334 | 334 | } |
@@ -60,7 +60,7 @@ |
||
60 | 60 | foreach (ReflectionUtility::getPublicMethodNames($hookClass) as $methodName) { |
61 | 61 | $tagConfiguration = ReflectionUtility::getTagConfigurationForMethod($hookClass, $methodName, ['hook']); |
62 | 62 | if (\count($tagConfiguration['hook']) > 0) { |
63 | - $hookLocations = \array_map(function ($hook) { |
|
63 | + $hookLocations = \array_map(function($hook) { |
|
64 | 64 | return \trim($hook, " \t\n\r\0\x0B|"); |
65 | 65 | }, $tagConfiguration['hook']); |
66 | 66 |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | */ |
205 | 205 | protected function useTableNameFileBase() |
206 | 206 | { |
207 | - $configuration = \unserialize((string) $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['autoloader']); |
|
207 | + $configuration = \unserialize((string)$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['autoloader']); |
|
208 | 208 | |
209 | - return isset($configuration['enableLanguageFileOnTableBase']) ? (bool) $configuration['enableLanguageFileOnTableBase'] : false; |
|
209 | + return isset($configuration['enableLanguageFileOnTableBase']) ? (bool)$configuration['enableLanguageFileOnTableBase'] : false; |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -276,9 +276,9 @@ discard block |
||
276 | 276 | $fields[] = [ |
277 | 277 | 'property' => $propertyName, |
278 | 278 | 'name' => $nameMapperService->getDatabaseFieldName($tableName, $propertyName), |
279 | - 'db' => \trim((string) $configuration['db'][0]), |
|
280 | - 'var' => \trim((string) $var), |
|
281 | - 'rte' => (bool) !empty($configuration['enableRichText'][0]), |
|
279 | + 'db' => \trim((string)$configuration['db'][0]), |
|
280 | + 'var' => \trim((string)$var), |
|
281 | + 'rte' => (bool)!empty($configuration['enableRichText'][0]), |
|
282 | 282 | ]; |
283 | 283 | } |
284 | 284 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $classReflection = ReflectionUtility::createReflectionClass($modelClassName); |
342 | 342 | if ($classReflection->isTaggedWith('key')) { |
343 | 343 | $additionalKeys = $classReflection->getTagValues('key'); |
344 | - \array_walk($additionalKeys, function (&$item) { |
|
344 | + \array_walk($additionalKeys, function(&$item) { |
|
345 | 345 | $item = 'KEY ' . $item; |
346 | 346 | }); |
347 | 347 | $fields = \array_merge($fields, $additionalKeys); |
@@ -29,8 +29,8 @@ |
||
29 | 29 | } |
30 | 30 | try { |
31 | 31 | $reflection = new \ReflectionClass($type); |
32 | - while($reflection = $reflection->getParentClass()) { |
|
33 | - if($reflection->getName() === AbstractEntity::class) { |
|
32 | + while ($reflection = $reflection->getParentClass()) { |
|
33 | + if ($reflection->getName() === AbstractEntity::class) { |
|
34 | 34 | return true; |
35 | 35 | } |
36 | 36 | } |