@@ -1,4 +1,4 @@ |
||
1 | -<?php declare (strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Limoncello\Flute\Contracts\Encoder; |
4 | 4 |
@@ -3,20 +3,20 @@ |
||
3 | 3 | namespace Limoncello\Flute\Contracts\Models; |
4 | 4 | |
5 | 5 | /** |
6 | - * Copyright 2015-2019 [email protected] |
|
7 | - * |
|
8 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
|
9 | - * you may not use this file except in compliance with the License. |
|
10 | - * You may obtain a copy of the License at |
|
11 | - * |
|
12 | - * http://www.apache.org/licenses/LICENSE-2.0 |
|
13 | - * |
|
14 | - * Unless required by applicable law or agreed to in writing, software |
|
15 | - * distributed under the License is distributed on an "AS IS" BASIS, |
|
16 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
17 | - * See the License for the specific language governing permissions and |
|
18 | - * limitations under the License. |
|
19 | - */ |
|
6 | + * Copyright 2015-2019 [email protected] |
|
7 | + * |
|
8 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
|
9 | + * you may not use this file except in compliance with the License. |
|
10 | + * You may obtain a copy of the License at |
|
11 | + * |
|
12 | + * http://www.apache.org/licenses/LICENSE-2.0 |
|
13 | + * |
|
14 | + * Unless required by applicable law or agreed to in writing, software |
|
15 | + * distributed under the License is distributed on an "AS IS" BASIS, |
|
16 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
17 | + * See the License for the specific language governing permissions and |
|
18 | + * limitations under the License. |
|
19 | + */ |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @package Limoncello\Flute |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare (strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Limoncello\Flute\Contracts\Models; |
4 | 4 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare (strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Limoncello\Flute\Contracts\Validation; |
4 | 4 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare (strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Limoncello\Flute\Schema; |
4 | 4 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | if ($belongsToFkName !== null && $this->hasProperty($model, $belongsToFkName) === true) { |
163 | 163 | $reverseIndex = $model->{$belongsToFkName}; |
164 | 164 | $identifier = $reverseIndex === null ? |
165 | - null : new Identifier((string)$reverseIndex, $reverseType, false, null); |
|
165 | + null : new Identifier((string) $reverseIndex, $reverseType, false, null); |
|
166 | 166 | |
167 | 167 | yield $jsonRelName => [ |
168 | 168 | static::RELATIONSHIP_DATA => $identifier, |
@@ -237,14 +237,14 @@ discard block |
||
237 | 237 | // if we are here then relationship contains paginated data, so we have to add pagination links |
238 | 238 | $offset = $relationshipData->getOffset(); |
239 | 239 | $limit = $relationshipData->getLimit(); |
240 | - $urlPrefix = $this->getRelationshipSelfSubUrl($model, $jsonRelName) . '?'; |
|
241 | - $buildLink = function (int $offset, int $limit) use ($urlPrefix) : LinkInterface { |
|
240 | + $urlPrefix = $this->getRelationshipSelfSubUrl($model, $jsonRelName).'?'; |
|
241 | + $buildLink = function(int $offset, int $limit) use ($urlPrefix) : LinkInterface { |
|
242 | 242 | $paramsWithPaging = [ |
243 | 243 | JsonApiQueryParserInterface::PARAM_PAGING_OFFSET => $offset, |
244 | 244 | JsonApiQueryParserInterface::PARAM_PAGING_LIMIT => $limit, |
245 | 245 | ]; |
246 | 246 | |
247 | - $subUrl = $urlPrefix . http_build_query($paramsWithPaging); |
|
247 | + $subUrl = $urlPrefix.http_build_query($paramsWithPaging); |
|
248 | 248 | |
249 | 249 | return $this->getFactory()->createLink(true, $subUrl, false); |
250 | 250 | }; |
@@ -343,6 +343,6 @@ discard block |
||
343 | 343 | */ |
344 | 344 | private function getRelationshipSelfSubUrl(ModelInterface $model, string $jsonRelName): string |
345 | 345 | { |
346 | - return $this->getSelfSubUrl($model) . '/relationships/' . $jsonRelName; |
|
346 | + return $this->getSelfSubUrl($model).'/relationships/'.$jsonRelName; |
|
347 | 347 | } |
348 | 348 | } |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare (strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Limoncello\Flute\Schema; |
4 | 4 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare (strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Limoncello\Flute\Api; |
4 | 4 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare (strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Limoncello\Flute\Package; |
4 | 4 | |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | ); |
105 | 105 | assert(empty($jsonQueryValFileMask) === false, "Invalid Query Validators file mask `$jsonQueryValFileMask`."); |
106 | 106 | |
107 | - $schemasPath = $schemasFolder . DIRECTORY_SEPARATOR . $schemasFileMask; |
|
108 | - $jsonDataValPath = $jsonDataValFolder . DIRECTORY_SEPARATOR . $jsonDataValFileMask; |
|
109 | - $formsValidatorsPath = $formsValFolder . DIRECTORY_SEPARATOR . $formsValFileMask; |
|
110 | - $jsonQueryValPath = $jsonQueryValFolder . DIRECTORY_SEPARATOR . $jsonQueryValFileMask; |
|
107 | + $schemasPath = $schemasFolder.DIRECTORY_SEPARATOR.$schemasFileMask; |
|
108 | + $jsonDataValPath = $jsonDataValFolder.DIRECTORY_SEPARATOR.$jsonDataValFileMask; |
|
109 | + $formsValidatorsPath = $formsValFolder.DIRECTORY_SEPARATOR.$formsValFileMask; |
|
110 | + $jsonQueryValPath = $jsonQueryValFolder.DIRECTORY_SEPARATOR.$jsonQueryValFileMask; |
|
111 | 111 | |
112 | 112 | $requireUniqueTypes = $defaults[static::KEY_SCHEMAS_REQUIRE_UNIQUE_TYPES] ?? true; |
113 | 113 |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare (strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Limoncello\Flute\Package; |
4 | 4 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $container[FactoryInterface::class] = $factory; |
57 | 57 | |
58 | - $container[JsonSchemasInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
58 | + $container[JsonSchemasInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
59 | 59 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
60 | 60 | $modelSchemas = $container->get(ModelSchemaInfoInterface::class); |
61 | 61 | |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | ); |
67 | 67 | }; |
68 | 68 | |
69 | - $container[ParametersMapperInterface::class] = function (PsrContainerInterface $container) { |
|
69 | + $container[ParametersMapperInterface::class] = function(PsrContainerInterface $container) { |
|
70 | 70 | return new ParametersMapper($container->get(JsonSchemasInterface::class)); |
71 | 71 | }; |
72 | 72 | |
73 | - $container[EncoderInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
73 | + $container[EncoderInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
74 | 74 | /** @var JsonSchemasInterface $jsonSchemas */ |
75 | 75 | $jsonSchemas = $container->get(JsonSchemasInterface::class); |
76 | 76 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
@@ -86,19 +86,19 @@ discard block |
||
86 | 86 | return $encoder; |
87 | 87 | }; |
88 | 88 | |
89 | - $container[RelationshipPaginationStrategyInterface::class] = function (PsrContainerInterface $container) { |
|
89 | + $container[RelationshipPaginationStrategyInterface::class] = function(PsrContainerInterface $container) { |
|
90 | 90 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
91 | 91 | |
92 | 92 | return new BasicRelationshipPaginationStrategy($settings[FluteSettings::KEY_DEFAULT_PAGING_SIZE]); |
93 | 93 | }; |
94 | 94 | |
95 | - $container[JsonApiParserFactoryInterface::class] = function (PsrContainerInterface $container) { |
|
95 | + $container[JsonApiParserFactoryInterface::class] = function(PsrContainerInterface $container) { |
|
96 | 96 | $factory = new JsonApiParserFactory($container); |
97 | 97 | |
98 | 98 | return $factory; |
99 | 99 | }; |
100 | 100 | |
101 | - $container[FormValidatorFactoryInterface::class] = function (PsrContainerInterface $container) { |
|
101 | + $container[FormValidatorFactoryInterface::class] = function(PsrContainerInterface $container) { |
|
102 | 102 | $factory = new FormValidatorFactory($container); |
103 | 103 | |
104 | 104 | return $factory; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public static function configureExceptionHandler(LimoncelloContainerInterface $container) |
118 | 118 | { |
119 | - $container[ThrowableHandlerInterface::class] = function (PsrContainerInterface $container) { |
|
119 | + $container[ThrowableHandlerInterface::class] = function(PsrContainerInterface $container) { |
|
120 | 120 | /** @var CacheSettingsProviderInterface $provider */ |
121 | 121 | $provider = $container->get(CacheSettingsProviderInterface::class); |
122 | 122 | $appConfig = $provider->getApplicationConfiguration(); |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare (strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Limoncello\Flute\Package; |
4 | 4 |