@@ -64,7 +64,7 @@ |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | - * @param string|DateTime $value |
|
67 | + * @param string $value |
|
68 | 68 | * @param string $fromFormat |
69 | 69 | * @param string $toFormat |
70 | 70 | * |
@@ -186,7 +186,7 @@ |
||
186 | 186 | return [static::DATA => $data->getData()]; |
187 | 187 | } |
188 | 188 | |
189 | - $buildUrl = function ($offset) use ($data, $uri) { |
|
189 | + $buildUrl = function($offset) use ($data, $uri) { |
|
190 | 190 | $paramsWithPaging = [ |
191 | 191 | PaginationStrategyInterface::PARAM_PAGING_SKIP => $offset, |
192 | 192 | PaginationStrategyInterface::PARAM_PAGING_SIZE => $data->getLimit(), |
@@ -343,7 +343,7 @@ |
||
343 | 343 | $attributeRules = $this->getRules()[static::RULE_ATTRIBUTES] ?? []; |
344 | 344 | $schema = $this->getSchema(); |
345 | 345 | $attributeTypes = $this->getModelSchemes()->getAttributeTypes($schema::MODEL); |
346 | - $createTypedCapture = function (string $name, RuleInterface $rule) use ($attributeTypes, $schema) { |
|
346 | + $createTypedCapture = function(string $name, RuleInterface $rule) use ($attributeTypes, $schema) { |
|
347 | 347 | $captureName = $schema->getAttributeMapping($name); |
348 | 348 | $attributeType = $attributeTypes[$captureName] ?? Type::STRING; |
349 | 349 | $untypedCapture = static::singleCapture($captureName, $rule, $this->getCaptureAggregator()); |
@@ -46,22 +46,22 @@ discard block |
||
46 | 46 | { |
47 | 47 | $factory = new Factory($container); |
48 | 48 | |
49 | - $container[FactoryInterface::class] = function () use ($factory) { |
|
49 | + $container[FactoryInterface::class] = function() use ($factory) { |
|
50 | 50 | return $factory; |
51 | 51 | }; |
52 | 52 | |
53 | - $container[QueryParametersParserInterface::class] = function () use ($factory) { |
|
53 | + $container[QueryParametersParserInterface::class] = function() use ($factory) { |
|
54 | 54 | return $factory->getJsonApiFactory()->createQueryParametersParser(); |
55 | 55 | }; |
56 | 56 | |
57 | - $container[JsonSchemesInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
57 | + $container[JsonSchemesInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
58 | 58 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
59 | 59 | $modelSchemes = $container->get(ModelSchemeInfoInterface::class); |
60 | 60 | |
61 | 61 | return $factory->createJsonSchemes($settings[FluteSettings::KEY_MODEL_TO_SCHEME_MAP], $modelSchemes); |
62 | 62 | }; |
63 | 63 | |
64 | - $container[EncoderInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
64 | + $container[EncoderInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
65 | 65 | /** @var JsonSchemesInterface $jsonSchemes */ |
66 | 66 | $jsonSchemes = $container->get(JsonSchemesInterface::class); |
67 | 67 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $settings[FluteSettings::KEY_URI_PREFIX], |
71 | 71 | $settings[FluteSettings::KEY_JSON_ENCODE_DEPTH] |
72 | 72 | )); |
73 | - isset($settings[FluteSettings::KEY_META]) ? $encoder->withMeta($settings[FluteSettings::KEY_META]): null; |
|
73 | + isset($settings[FluteSettings::KEY_META]) ? $encoder->withMeta($settings[FluteSettings::KEY_META]) : null; |
|
74 | 74 | ($settings[FluteSettings::KEY_IS_SHOW_VERSION] ?? false) ? $encoder->withJsonApiVersion() : null; |
75 | 75 | |
76 | 76 | return $encoder; |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | $container[TranslatorInterface::class] = $translator = $factory->createTranslator(); |
80 | 80 | $container[FilterOperationsInterface::class] = $filerOps = new FilterOperations($translator); |
81 | 81 | |
82 | - $container[ValidationTranslatorInterface::class] = function () { |
|
82 | + $container[ValidationTranslatorInterface::class] = function() { |
|
83 | 83 | // TODO load locale according to current user preferences |
84 | 84 | return new Translator(EnUsLocale::getLocaleCode(), EnUsLocale::getMessages()); |
85 | 85 | }; |
86 | 86 | |
87 | - $container[RepositoryInterface::class] = function (PsrContainerInterface $container) use ( |
|
87 | + $container[RepositoryInterface::class] = function(PsrContainerInterface $container) use ( |
|
88 | 88 | $factory, |
89 | 89 | $filerOps, |
90 | 90 | $translator |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | return $factory->createRepository($connection, $modelSchemes, $filerOps, $translator); |
97 | 97 | }; |
98 | 98 | |
99 | - $container[PaginationStrategyInterface::class] = function (PsrContainerInterface $container) { |
|
99 | + $container[PaginationStrategyInterface::class] = function(PsrContainerInterface $container) { |
|
100 | 100 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
101 | 101 | |
102 | 102 | return new PaginationStrategy($settings[FluteSettings::KEY_RELATIONSHIP_PAGING_SIZE]); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public static function configureExceptionHandler(LimoncelloContainerInterface $container) |
120 | 120 | { |
121 | - $container[ExceptionHandlerInterface::class] = function () { |
|
121 | + $container[ExceptionHandlerInterface::class] = function() { |
|
122 | 122 | return new FluteExceptionHandler(); |
123 | 123 | }; |
124 | 124 | } |
@@ -157,7 +157,7 @@ |
||
157 | 157 | { |
158 | 158 | parse_str($this->getOriginalUri()->getQuery(), $queryParams); |
159 | 159 | |
160 | - return function ($offset) use ($pageSize, $queryParams) { |
|
160 | + return function($offset) use ($pageSize, $queryParams) { |
|
161 | 161 | $paramsWithPaging = array_merge($queryParams, [ |
162 | 162 | QueryParametersParserInterface::PARAM_PAGE => [ |
163 | 163 | PaginationStrategyInterface::PARAM_PAGING_SKIP => $offset, |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php namespace Limoncello\Flute\Contracts\Models; |
2 | 2 | |
3 | 3 | /** |
4 | - * Copyright 2015-2017 [email protected] |
|
5 | - * |
|
6 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | - * you may not use this file except in compliance with the License. |
|
8 | - * You may obtain a copy of the License at |
|
9 | - * |
|
10 | - * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | - * |
|
12 | - * Unless required by applicable law or agreed to in writing, software |
|
13 | - * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | - * See the License for the specific language governing permissions and |
|
16 | - * limitations under the License. |
|
17 | - */ |
|
4 | + * Copyright 2015-2017 [email protected] |
|
5 | + * |
|
6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | + * you may not use this file except in compliance with the License. |
|
8 | + * You may obtain a copy of the License at |
|
9 | + * |
|
10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | + * |
|
12 | + * Unless required by applicable law or agreed to in writing, software |
|
13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | + * See the License for the specific language governing permissions and |
|
16 | + * limitations under the License. |
|
17 | + */ |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @package Limoncello\Flute |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php namespace Limoncello\Flute\Contracts\Models; |
2 | 2 | |
3 | 3 | /** |
4 | - * Copyright 2015-2017 [email protected] |
|
5 | - * |
|
6 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | - * you may not use this file except in compliance with the License. |
|
8 | - * You may obtain a copy of the License at |
|
9 | - * |
|
10 | - * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | - * |
|
12 | - * Unless required by applicable law or agreed to in writing, software |
|
13 | - * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | - * See the License for the specific language governing permissions and |
|
16 | - * limitations under the License. |
|
17 | - */ |
|
4 | + * Copyright 2015-2017 [email protected] |
|
5 | + * |
|
6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | + * you may not use this file except in compliance with the License. |
|
8 | + * You may obtain a copy of the License at |
|
9 | + * |
|
10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | + * |
|
12 | + * Unless required by applicable law or agreed to in writing, software |
|
13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | + * See the License for the specific language governing permissions and |
|
16 | + * limitations under the License. |
|
17 | + */ |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @package Limoncello\Flute |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php namespace Limoncello\Flute\Contracts\Models; |
2 | 2 | |
3 | 3 | /** |
4 | - * Copyright 2015-2017 [email protected] |
|
5 | - * |
|
6 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | - * you may not use this file except in compliance with the License. |
|
8 | - * You may obtain a copy of the License at |
|
9 | - * |
|
10 | - * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | - * |
|
12 | - * Unless required by applicable law or agreed to in writing, software |
|
13 | - * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | - * See the License for the specific language governing permissions and |
|
16 | - * limitations under the License. |
|
17 | - */ |
|
4 | + * Copyright 2015-2017 [email protected] |
|
5 | + * |
|
6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | + * you may not use this file except in compliance with the License. |
|
8 | + * You may obtain a copy of the License at |
|
9 | + * |
|
10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | + * |
|
12 | + * Unless required by applicable law or agreed to in writing, software |
|
13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | + * See the License for the specific language governing permissions and |
|
16 | + * limitations under the License. |
|
17 | + */ |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @package Limoncello\Flute |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php namespace Limoncello\Flute\Contracts\Models; |
2 | 2 | |
3 | 3 | /** |
4 | - * Copyright 2015-2017 [email protected] |
|
5 | - * |
|
6 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | - * you may not use this file except in compliance with the License. |
|
8 | - * You may obtain a copy of the License at |
|
9 | - * |
|
10 | - * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | - * |
|
12 | - * Unless required by applicable law or agreed to in writing, software |
|
13 | - * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | - * See the License for the specific language governing permissions and |
|
16 | - * limitations under the License. |
|
17 | - */ |
|
4 | + * Copyright 2015-2017 [email protected] |
|
5 | + * |
|
6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | + * you may not use this file except in compliance with the License. |
|
8 | + * You may obtain a copy of the License at |
|
9 | + * |
|
10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | + * |
|
12 | + * Unless required by applicable law or agreed to in writing, software |
|
13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | + * See the License for the specific language governing permissions and |
|
16 | + * limitations under the License. |
|
17 | + */ |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @package Limoncello\Flute |