@@ -65,7 +65,7 @@ |
||
65 | 65 | * |
66 | 66 | * @return string|null |
67 | 67 | */ |
68 | - protected static function reqGetResourceType(ContextInterface $context): ?string |
|
68 | + protected static function reqGetResourceType(ContextInterface $context): ? string |
|
69 | 69 | { |
70 | 70 | assert(static::reqHasResourceType($context)); |
71 | 71 |
@@ -120,7 +120,7 @@ |
||
120 | 120 | * |
121 | 121 | * @return string|null |
122 | 122 | */ |
123 | - private function getResourcesType(string $className): ?string |
|
123 | + private function getResourcesType(string $className): ? string |
|
124 | 124 | { |
125 | 125 | $resourceType = null; |
126 | 126 | if (array_key_exists(ResourceAuthorizationRulesInterface::class, class_implements($className)) === true) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $nextIndex = 0; |
172 | 172 | $hashMap = []; // hash => index |
173 | 173 | $settingsData = []; // index => instance data |
174 | - $getIndex = function (SettingsInterface $instance) use (&$nextIndex, &$hashMap, &$settingsData): int { |
|
174 | + $getIndex = function(SettingsInterface $instance) use (&$nextIndex, &$hashMap, &$settingsData): int { |
|
175 | 175 | $hash = spl_object_hash($instance); |
176 | 176 | if (array_key_exists($hash, $hashMap) === true) { |
177 | 177 | $index = $hashMap[$hash]; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * |
211 | 211 | * @return SettingsInterface|null |
212 | 212 | */ |
213 | - private function selectChildSettings(array $instanceList): ?SettingsInterface |
|
213 | + private function selectChildSettings(array $instanceList): ? SettingsInterface |
|
214 | 214 | { |
215 | 215 | $count = count($instanceList); |
216 | 216 | assert($count > 1); |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | private function selectChildSettingsAmongTwo( |
237 | 237 | SettingsInterface $instance1, |
238 | 238 | SettingsInterface $instance2 |
239 | - ) : ?SettingsInterface { |
|
239 | + ) : ? SettingsInterface { |
|
240 | 240 | return is_subclass_of($instance1, get_class($instance2)) === true ? |
241 | 241 | $instance1 : (is_subclass_of($instance2, get_class($instance1)) === true ? $instance2 : null); |
242 | 242 | } |
@@ -104,7 +104,7 @@ |
||
104 | 104 | public function setData(array $data): self |
105 | 105 | { |
106 | 106 | list($this->foreignKeys, $this->belongsToMany, $this->relationshipTypes, |
107 | - $this->reversedRelationships,$this->tableNames, $this->primaryKeys, |
|
107 | + $this->reversedRelationships, $this->tableNames, $this->primaryKeys, |
|
108 | 108 | $this->attributeTypes, $this->attributeLengths, $this->attributes, $this->reversedClasses) = $data; |
109 | 109 | |
110 | 110 | return $this; |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | public static function configureContainer(LimoncelloContainerInterface $container): void |
39 | 39 | { |
40 | 40 | $container[ModelSchemeInfoInterface::class] = |
41 | - function (PsrContainerInterface $container): ModelSchemeInfoInterface { |
|
41 | + function(PsrContainerInterface $container): ModelSchemeInfoInterface { |
|
42 | 42 | $settings = $container->get(SettingsProviderInterface::class)->get(DataSettings::class); |
43 | 43 | $data = $settings[DataSettings::KEY_MODELS_SCHEME_INFO]; |
44 | 44 | |
45 | 45 | return (new ModelSchemeInfo())->setData($data); |
46 | 46 | }; |
47 | 47 | |
48 | - $container[Connection::class] = function (PsrContainerInterface $container): Connection { |
|
48 | + $container[Connection::class] = function(PsrContainerInterface $container): Connection { |
|
49 | 49 | $settings = $container->get(SettingsProviderInterface::class)->get(DoctrineSettings::class); |
50 | 50 | $params = array_filter([ |
51 | 51 | 'driver' => $settings[DoctrineSettings::KEY_DRIVER] ?? null, |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'memory' => $settings[DoctrineSettings::KEY_MEMORY] ?? null, |
59 | 59 | 'path' => $settings[DoctrineSettings::KEY_PATH] ?? null, |
60 | 60 | 'charset' => $settings[DoctrineSettings::KEY_CHARSET] ?? 'UTF8', |
61 | - ], function ($value) { |
|
61 | + ], function($value) { |
|
62 | 62 | return $value !== null; |
63 | 63 | }); |
64 | 64 | $extra = $settings[DoctrineSettings::KEY_EXTRA] ?? []; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | public static function configureContainer(LimoncelloContainerInterface $container): void |
39 | 39 | { |
40 | 40 | $container[CommandStorageInterface::class] = |
41 | - function (PsrContainerInterface $container): CommandStorageInterface { |
|
41 | + function(PsrContainerInterface $container): CommandStorageInterface { |
|
42 | 42 | $creator = new class |
43 | 43 | { |
44 | 44 | use ClassIsTrait; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $routeConfigurators = []; |
99 | 99 | if (empty($method) === false && empty($path) === false) { |
100 | - list(, , , , , $routeConfigurators) = $this->initRouter($coreSettings)->match($method, $path); |
|
100 | + list(,,,,, $routeConfigurators) = $this->initRouter($coreSettings)->match($method, $path); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // configure container |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | protected function createThrowableHandler(SapiInterface $sapi, PsrContainerInterface $container): Closure |
212 | 212 | { |
213 | - return function (Throwable $throwable) use ($sapi, $container) { |
|
213 | + return function(Throwable $throwable) use ($sapi, $container) { |
|
214 | 214 | $handler = $this->createExceptionHandler($container); |
215 | 215 | $handler->handleThrowable($throwable, $sapi, $container); |
216 | 216 | }; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | protected function createErrorHandler(SapiInterface $sapi, PsrContainerInterface $container): Closure |
226 | 226 | { |
227 | - return function ($severity, $message, $fileName, $lineNumber) use ($sapi, $container) { |
|
227 | + return function($severity, $message, $fileName, $lineNumber) use ($sapi, $container) { |
|
228 | 228 | $errorException = new ErrorException($message, 0, $severity, $fileName, $lineNumber); |
229 | 229 | $handler = $this->createThrowableHandler($sapi, $container); |
230 | 230 | $handler($errorException); |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | */ |
240 | 240 | protected function createFatalErrorHandler(PsrContainerInterface $container): Closure |
241 | 241 | { |
242 | - return function () use ($container) { |
|
242 | + return function() use ($container) { |
|
243 | 243 | $error = $this->getLastError(); |
244 | 244 | if ($error !== null && ((int)$error['type'] & (E_ERROR | E_COMPILE_ERROR))) { |
245 | 245 | $handler = $this->createExceptionHandler($container); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * |
254 | 254 | * @return array|null |
255 | 255 | */ |
256 | - protected function getLastError(): ?array |
|
256 | + protected function getLastError(): ? array |
|
257 | 257 | { |
258 | 258 | return error_get_last(); |
259 | 259 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | */ |
74 | 74 | private function handle(Throwable $exception, SapiInterface $sapi, ContainerInterface $container): void |
75 | 75 | { |
76 | - $message = 'Internal Server Error'; |
|
76 | + $message = 'Internal Server Error'; |
|
77 | 77 | |
78 | 78 | $this->logException($exception, $container, $message); |
79 | 79 |