@@ -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 | $modelSchemas = new ModelSchemaInfo(); |
132 | - $registerModel = function ($modelClass) use ($modelSchemas, &$registered, $requireReverseRel) { |
|
132 | + $registerModel = function($modelClass) use ($modelSchemas, &$registered, $requireReverseRel) { |
|
133 | 133 | /** @var ModelInterface $modelClass */ |
134 | 134 | $modelSchemas->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 | $modelSchemas->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 | } |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | public static function configureContainer(LimoncelloContainerInterface $container): void |
39 | 39 | { |
40 | 40 | $container[ModelSchemaInfoInterface::class] = |
41 | - function (PsrContainerInterface $container): ModelSchemaInfoInterface { |
|
41 | + function(PsrContainerInterface $container): ModelSchemaInfoInterface { |
|
42 | 42 | $settings = $container->get(SettingsProviderInterface::class)->get(DataSettings::class); |
43 | 43 | $data = $settings[DataSettings::KEY_MODELS_SCHEMA_INFO]; |
44 | 44 | |
45 | 45 | return (new ModelSchemaInfo())->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] ?? []; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $appConfig = $this->getAppConfig(); |
109 | 109 | |
110 | - $defaults[static::KEY_LOG_IS_ENABLED] = (bool)($appConfig[A::KEY_IS_LOG_ENABLED] ?? false); |
|
110 | + $defaults[static::KEY_LOG_IS_ENABLED] = (bool) ($appConfig[A::KEY_IS_LOG_ENABLED] ?? false); |
|
111 | 111 | |
112 | 112 | if (array_key_exists(A::KEY_APP_ORIGIN_SCHEMA, $appConfig) === true && |
113 | 113 | array_key_exists(A::KEY_APP_ORIGIN_HOST, $appConfig) === true && |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | * @see http://php.net/manual/function.parse-url.php |
120 | 120 | */ |
121 | 121 | $defaults[static::KEY_SERVER_ORIGIN] = [ |
122 | - static::KEY_SERVER_ORIGIN_SCHEMA => (string)$appConfig[A::KEY_APP_ORIGIN_SCHEMA], |
|
123 | - static::KEY_SERVER_ORIGIN_HOST => (string)$appConfig[A::KEY_APP_ORIGIN_HOST], |
|
124 | - static::KEY_SERVER_ORIGIN_PORT => (string)$appConfig[A::KEY_APP_ORIGIN_PORT], |
|
122 | + static::KEY_SERVER_ORIGIN_SCHEMA => (string) $appConfig[A::KEY_APP_ORIGIN_SCHEMA], |
|
123 | + static::KEY_SERVER_ORIGIN_HOST => (string) $appConfig[A::KEY_APP_ORIGIN_HOST], |
|
124 | + static::KEY_SERVER_ORIGIN_PORT => (string) $appConfig[A::KEY_APP_ORIGIN_PORT], |
|
125 | 125 | ]; |
126 | 126 | } |
127 | 127 |