@@ -38,7 +38,7 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public static function configureContainer(LimoncelloContainerInterface $container): void |
| 40 | 40 | { |
| 41 | - $container[AnalyzerInterface::class] = function (PsrContainerInterface $container) { |
|
| 41 | + $container[AnalyzerInterface::class] = function(PsrContainerInterface $container) { |
|
| 42 | 42 | $settingsProvider = $container->get(SettingsProviderInterface::class); |
| 43 | 43 | $corsSettings = $settingsProvider->get(C::class); |
| 44 | 44 | $analyzer = Analyzer::instance(new Settings($corsSettings)); |
@@ -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 | /** |
@@ -165,19 +165,19 @@ |
||
| 165 | 165 | public function __construct() |
| 166 | 166 | { |
| 167 | 167 | $this |
| 168 | - ->setRetrieveCallable(function (string $key) { |
|
| 168 | + ->setRetrieveCallable(function(string $key) { |
|
| 169 | 169 | return $_SESSION[$key]; |
| 170 | 170 | }) |
| 171 | - ->setPutCallable(function (string $key, $serializable): void { |
|
| 171 | + ->setPutCallable(function(string $key, $serializable): void { |
|
| 172 | 172 | $_SESSION[$key] = $serializable; |
| 173 | 173 | }) |
| 174 | - ->setHasCallable(function (string $key): bool { |
|
| 174 | + ->setHasCallable(function(string $key): bool { |
|
| 175 | 175 | return array_key_exists($key, $_SESSION); |
| 176 | 176 | }) |
| 177 | - ->setDeleteCallable(function (string $key): void { |
|
| 177 | + ->setDeleteCallable(function(string $key): void { |
|
| 178 | 178 | unset($_SESSION[$key]); |
| 179 | 179 | }) |
| 180 | - ->setIteratorCallable(function (): Iterator { |
|
| 180 | + ->setIteratorCallable(function(): Iterator { |
|
| 181 | 181 | return new ArrayIterator($_SESSION); |
| 182 | 182 | }) |
| 183 | 183 | ->setAbortCallable('\session_abort') |
@@ -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; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | ); |
| 89 | 89 | assert(file_exists($seedsListFile) === true, "Invalid Seeds file `$seedsListFile`."); |
| 90 | 90 | |
| 91 | - $modelsPath = $modelsFolder . DIRECTORY_SEPARATOR . $modelsFileMask; |
|
| 91 | + $modelsPath = $modelsFolder.DIRECTORY_SEPARATOR.$modelsFileMask; |
|
| 92 | 92 | |
| 93 | 93 | $seedInit = $defaults[static::KEY_SEED_INIT] ?? null; |
| 94 | 94 | assert( |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | $registered = []; |
| 131 | 131 | $modelSchemes = new ModelSchemeInfo(); |
| 132 | - $registerModel = function ($modelClass) use ($modelSchemes, &$registered, $requireReverseRel) { |
|
| 132 | + $registerModel = function($modelClass) use ($modelSchemes, &$registered, $requireReverseRel) { |
|
| 133 | 133 | /** @var ModelInterface $modelClass */ |
| 134 | 134 | $modelSchemes->registerClass( |
| 135 | 135 | $modelClass, |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | foreach ($relationships[RelationshipTypes::BELONGS_TO] as $relName => list($rClass, $fKey, $rRel)) { |
| 146 | 146 | /** @var string $rClass */ |
| 147 | 147 | $modelSchemes->registerBelongsToOneRelationship($modelClass, $relName, $fKey, $rClass, $rRel); |
| 148 | - $registered[(string)$modelClass][$relName] = true; |
|
| 148 | + $registered[(string) $modelClass][$relName] = true; |
|
| 149 | 149 | $registered[$rClass][$rRel] = true; |
| 150 | 150 | |
| 151 | 151 | // Sanity check. Every `belongs_to` should be paired with `has_many` on the other side. |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $rRelationships[RelationshipTypes::HAS_MANY][$rRel] === [$modelClass, $fKey, $relName]); |
| 157 | 157 | /** @var string $modelClass */ |
| 158 | 158 | |
| 159 | - assert($isRelationshipOk, "`belongsTo` relationship `$relName` of class $modelClass " . |
|
| 159 | + assert($isRelationshipOk, "`belongsTo` relationship `$relName` of class $modelClass ". |
|
| 160 | 160 | "should be paired with `hasMany` relationship."); |
| 161 | 161 | } |
| 162 | 162 | } |
@@ -170,14 +170,14 @@ discard block |
||
| 170 | 170 | (isset($rRelationships[RelationshipTypes::BELONGS_TO][$rRel]) === true && |
| 171 | 171 | $rRelationships[RelationshipTypes::BELONGS_TO][$rRel] === [$modelClass, $fKey, $relName]); |
| 172 | 172 | /** @var string $modelClass */ |
| 173 | - assert($isRelationshipOk, "`hasMany` relationship `$relName` of class $modelClass " . |
|
| 173 | + assert($isRelationshipOk, "`hasMany` relationship `$relName` of class $modelClass ". |
|
| 174 | 174 | "should be paired with `belongsTo` relationship."); |
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | if (array_key_exists(RelationshipTypes::BELONGS_TO_MANY, $relationships) === true) { |
| 179 | 179 | foreach ($relationships[RelationshipTypes::BELONGS_TO_MANY] as $relName => $data) { |
| 180 | - if (isset($registered[(string)$modelClass][$relName]) === true) { |
|
| 180 | + if (isset($registered[(string) $modelClass][$relName]) === true) { |
|
| 181 | 181 | continue; |
| 182 | 182 | } |
| 183 | 183 | /** @var string $rClass */ |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $rClass, |
| 192 | 192 | $rRel |
| 193 | 193 | ); |
| 194 | - $registered[(string)$modelClass][$relName] = true; |
|
| 194 | + $registered[(string) $modelClass][$relName] = true; |
|
| 195 | 195 | $registered[$rClass][$rRel] = true; |
| 196 | 196 | } |
| 197 | 197 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | "Invalid Policies folder `$policiesFolder`." |
| 62 | 62 | ); |
| 63 | 63 | assert(empty($policiesFileMask) === false, "Invalid Policies file mask `$policiesFileMask`."); |
| 64 | - $policiesPath = $policiesFolder . DIRECTORY_SEPARATOR . $policiesFileMask; |
|
| 64 | + $policiesPath = $policiesFolder.DIRECTORY_SEPARATOR.$policiesFileMask; |
|
| 65 | 65 | |
| 66 | 66 | $topPolicyName = $defaults[static::KEY_TOP_POLICY_NAME]; |
| 67 | 67 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | public static function configureContainer(LimoncelloContainerInterface $container): void |
| 39 | 39 | { |
| 40 | 40 | $container[CookieJarInterface::class] = |
| 41 | - function (PsrContainerInterface $container): CookieJarInterface { |
|
| 41 | + function(PsrContainerInterface $container): CookieJarInterface { |
|
| 42 | 42 | $settings = $container->get(SettingsProviderInterface::class)->get(CookieSettings::class); |
| 43 | 43 | |
| 44 | 44 | return new CookieJar( |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | }; |
| 52 | 52 | |
| 53 | 53 | $container[CookieFunctionsInterface::class] = |
| 54 | - function (PsrContainerInterface $container): CookieFunctionsInterface { |
|
| 54 | + function(PsrContainerInterface $container): CookieFunctionsInterface { |
|
| 55 | 55 | return new CookieFunctions(); |
| 56 | 56 | }; |
| 57 | 57 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | return [ |
| 101 | 101 | [ |
| 102 | 102 | static::OPTION_NAME => static::OPT_PATH, |
| 103 | - static::OPTION_DESCRIPTION => 'Path to a list of migrations or seeds. ' . |
|
| 103 | + static::OPTION_DESCRIPTION => 'Path to a list of migrations or seeds. '. |
|
| 104 | 104 | 'If not given a path from settings will be used.', |
| 105 | 105 | static::OPTION_SHORTCUT => 'i', |
| 106 | 106 | static::OPTION_MODE => static::OPTION_MODE__REQUIRED, |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $this->createSeedRunner($inOut, $path, $seedInit)->run($container); |
| 149 | 149 | break; |
| 150 | 150 | default: |
| 151 | - $inOut->writeError("Unsupported action `$action`." . PHP_EOL); |
|
| 151 | + $inOut->writeError("Unsupported action `$action`.".PHP_EOL); |
|
| 152 | 152 | break; |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | $routeConfigurators = []; |
| 109 | 109 | $coreData = $this->getCoreData(); |
| 110 | 110 | if (empty($method) === false && empty($path) === false) { |
| 111 | - list(, , , , , $routeConfigurators) = $this->initRouter($coreData)->match($method, $path); |
|
| 111 | + list(,,,,, $routeConfigurators) = $this->initRouter($coreData)->match($method, $path); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // configure container |