@@ -69,7 +69,7 @@ |
||
| 69 | 69 | { |
| 70 | 70 | is_dir($folderPath) === true ?: $this->throwEx(new FileSystemException()); |
| 71 | 71 | |
| 72 | - $iterator = call_user_func(function () use ($folderPath) { |
|
| 72 | + $iterator = call_user_func(function() use ($folderPath) { |
|
| 73 | 73 | foreach (new DirectoryIterator($folderPath) as $directoryIterator) { |
| 74 | 74 | /** @var DirectoryIterator $directoryIterator */ |
| 75 | 75 | if ($directoryIterator->isDot() === false) { |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | private function checkDoNotHaveRequiredParametersOnCreate(string $className): bool |
| 55 | 55 | { |
| 56 | 56 | try { |
| 57 | - $reflection = new ReflectionClass($className); |
|
| 57 | + $reflection = new ReflectionClass($className); |
|
| 58 | 58 | if ($reflection->isInstantiable() === false) { |
| 59 | 59 | throw new InvalidSettingsClassException($className); |
| 60 | 60 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public static function configureContainer(LimoncelloContainerInterface $container): void |
| 35 | 35 | { |
| 36 | - $container[PDO::class] = function (PsrContainerInterface $container) { |
|
| 36 | + $container[PDO::class] = function(PsrContainerInterface $container) { |
|
| 37 | 37 | $settings = $container->get(SettingsProviderInterface::class)->get(C::class); |
| 38 | 38 | $database = new PDO( |
| 39 | 39 | $settings[C::KEY_CONNECTION_STRING], |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public static function configureContainer(LimoncelloContainerInterface $container): void |
| 33 | 33 | { |
| 34 | - $container[FileSystemInterface::class] = function () { |
|
| 34 | + $container[FileSystemInterface::class] = function() { |
|
| 35 | 35 | return new FileSystem(); |
| 36 | 36 | }; |
| 37 | 37 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public static function configureContainer(LimoncelloContainerInterface $container): void |
| 37 | 37 | { |
| 38 | - $container[AuthorizationManagerInterface::class] = function (PsrContainerInterface $container) { |
|
| 38 | + $container[AuthorizationManagerInterface::class] = function(PsrContainerInterface $container) { |
|
| 39 | 39 | $settingsProvider = $container->get(SettingsProviderInterface::class); |
| 40 | 40 | $settings = $settingsProvider->get(S::class); |
| 41 | 41 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public static function configureContainer(LimoncelloContainerInterface $container): void |
| 39 | 39 | { |
| 40 | - $container[FormatterFactoryInterface::class] = function (PsrContainerInterface $container) { |
|
| 40 | + $container[FormatterFactoryInterface::class] = function(PsrContainerInterface $container) { |
|
| 41 | 41 | $settingsProvider = $container->get(SettingsProviderInterface::class); |
| 42 | 42 | $settings = $settingsProvider->get(S::class); |
| 43 | 43 | |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | - * @return array |
|
| 108 | + * @return string |
|
| 109 | 109 | */ |
| 110 | 110 | protected function getSettings(): array |
| 111 | 111 | { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ); |
| 74 | 74 | assert(file_exists($seedsListFile) === true, "Invalid Seeds file `$seedsListFile`."); |
| 75 | 75 | |
| 76 | - $modelsPath = $modelsFolder . DIRECTORY_SEPARATOR . $modelsFileMask; |
|
| 76 | + $modelsPath = $modelsFolder.DIRECTORY_SEPARATOR.$modelsFileMask; |
|
| 77 | 77 | |
| 78 | 78 | $seedInit = $defaults[static::KEY_SEED_INIT] ?? null; |
| 79 | 79 | assert( |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | $registered = []; |
| 118 | 118 | $modelSchemas = new ModelSchemaInfo(); |
| 119 | - $registerModel = function (string $modelClass) use ($modelSchemas, &$registered, $requireReverseRel) { |
|
| 119 | + $registerModel = function(string $modelClass) use ($modelSchemas, &$registered, $requireReverseRel) { |
|
| 120 | 120 | /** @var ModelInterface $modelClass */ |
| 121 | 121 | $modelSchemas->registerClass( |
| 122 | - (string)$modelClass, |
|
| 122 | + (string) $modelClass, |
|
| 123 | 123 | $modelClass::getTableName(), |
| 124 | 124 | $modelClass::getPrimaryKeyName(), |
| 125 | 125 | $modelClass::getAttributeTypes(), |
@@ -133,13 +133,13 @@ discard block |
||
| 133 | 133 | foreach ($relationships[RelationshipTypes::BELONGS_TO] as $relName => list($rClass, $fKey, $rRel)) { |
| 134 | 134 | /** @var string $rClass */ |
| 135 | 135 | $modelSchemas->registerBelongsToOneRelationship( |
| 136 | - (string)$modelClass, |
|
| 136 | + (string) $modelClass, |
|
| 137 | 137 | $relName, |
| 138 | 138 | $fKey, |
| 139 | 139 | $rClass, |
| 140 | 140 | $rRel |
| 141 | 141 | ); |
| 142 | - $registered[(string)$modelClass][$relName] = true; |
|
| 142 | + $registered[(string) $modelClass][$relName] = true; |
|
| 143 | 143 | $registered[$rClass][$rRel] = true; |
| 144 | 144 | |
| 145 | 145 | // Sanity check. Every `belongs_to` should be paired with `has_many` on the other side. |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $rRelationships[RelationshipTypes::HAS_MANY][$rRel] === [$modelClass, $fKey, $relName]); |
| 151 | 151 | /** @var string $modelClass */ |
| 152 | 152 | |
| 153 | - assert($isRelationshipOk, "`belongsTo` relationship `$relName` of class $modelClass " . |
|
| 153 | + assert($isRelationshipOk, "`belongsTo` relationship `$relName` of class $modelClass ". |
|
| 154 | 154 | "should be paired with `hasMany` relationship."); |
| 155 | 155 | } |
| 156 | 156 | } |
@@ -164,14 +164,14 @@ discard block |
||
| 164 | 164 | (isset($rRelationships[RelationshipTypes::BELONGS_TO][$rRel]) === true && |
| 165 | 165 | $rRelationships[RelationshipTypes::BELONGS_TO][$rRel] === [$modelClass, $fKey, $relName]); |
| 166 | 166 | /** @var string $modelClass */ |
| 167 | - assert($isRelationshipOk, "`hasMany` relationship `$relName` of class $modelClass " . |
|
| 167 | + assert($isRelationshipOk, "`hasMany` relationship `$relName` of class $modelClass ". |
|
| 168 | 168 | "should be paired with `belongsTo` relationship."); |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | if (array_key_exists(RelationshipTypes::BELONGS_TO_MANY, $relationships) === true) { |
| 173 | 173 | foreach ($relationships[RelationshipTypes::BELONGS_TO_MANY] as $relName => $data) { |
| 174 | - if (isset($registered[(string)$modelClass][$relName]) === true) { |
|
| 174 | + if (isset($registered[(string) $modelClass][$relName]) === true) { |
|
| 175 | 175 | continue; |
| 176 | 176 | } |
| 177 | 177 | /** @var string $rClass */ |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $rClass, |
| 186 | 186 | $rRel |
| 187 | 187 | ); |
| 188 | - $registered[(string)$modelClass][$relName] = true; |
|
| 188 | + $registered[(string) $modelClass][$relName] = true; |
|
| 189 | 189 | $registered[$rClass][$rRel] = true; |
| 190 | 190 | } |
| 191 | 191 | } |
@@ -150,7 +150,7 @@ |
||
| 150 | 150 | */ |
| 151 | 151 | public function setExpiresInSeconds(int $seconds): CookieInterface |
| 152 | 152 | { |
| 153 | - return $this->setExpiresAtUnixTime(time() + (int)max(0, $seconds)); |
|
| 153 | + return $this->setExpiresAtUnixTime(time() + (int) max(0, $seconds)); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public static function configureContainer(LimoncelloContainerInterface $container): void |
| 36 | 36 | { |
| 37 | - $container[SessionInterface::class] = function (PsrContainerInterface $container): SessionInterface { |
|
| 37 | + $container[SessionInterface::class] = function(PsrContainerInterface $container): SessionInterface { |
|
| 38 | 38 | /** @var SessionFunctionsInterface $functions */ |
| 39 | 39 | $functions = $container->get(SessionFunctionsInterface::class); |
| 40 | 40 | $session = new Session($functions); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | return $session; |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | - $container[SessionFunctionsInterface::class] = function (): SessionFunctionsInterface { |
|
| 45 | + $container[SessionFunctionsInterface::class] = function(): SessionFunctionsInterface { |
|
| 46 | 46 | $functions = new SessionFunctions(); |
| 47 | 47 | |
| 48 | 48 | return $functions; |