@@ -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 | * |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php namespace Limoncello\Flute\Contracts\Adapters; |
| 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 |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | $details = null; |
| 100 | 100 | if ($this->isDebug === true) { |
| 101 | 101 | $message = $throwable->getMessage(); |
| 102 | - $details = (string)$throwable; |
|
| 102 | + $details = (string) $throwable; |
|
| 103 | 103 | } |
| 104 | 104 | $errors->add(new Error(null, null, $httpCode, null, $message, $details)); |
| 105 | 105 | } |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | assert(array_key_exists(SchemaInterface::class, class_implements($schemeClass)) === true); |
| 54 | 54 | $type = $schemeClass::TYPE; |
| 55 | 55 | |
| 56 | - $indexSlug = '/{' . CI::ROUTE_KEY_INDEX . '}'; |
|
| 57 | - $params = function ($method) use ($type) { |
|
| 58 | - return [RouteInterface::PARAM_NAME => $type . '_' . $method]; |
|
| 56 | + $indexSlug = '/{'.CI::ROUTE_KEY_INDEX.'}'; |
|
| 57 | + $params = function($method) use ($type) { |
|
| 58 | + return [RouteInterface::PARAM_NAME => $type.'_'.$method]; |
|
| 59 | 59 | }; |
| 60 | - $handler = function ($method) use ($controllerClass) { |
|
| 60 | + $handler = function($method) use ($controllerClass) { |
|
| 61 | 61 | return [$controllerClass, $method]; |
| 62 | 62 | }; |
| 63 | 63 | |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | $group->post($type, $handler(CI::METHOD_CREATE), $params(CI::METHOD_CREATE)); |
| 71 | 71 | } |
| 72 | 72 | if (in_array(ControllerReadInterface::class, $classInterfaces) === true) { |
| 73 | - $group->get($type . $indexSlug, $handler(CI::METHOD_READ), $params(CI::METHOD_READ)); |
|
| 73 | + $group->get($type.$indexSlug, $handler(CI::METHOD_READ), $params(CI::METHOD_READ)); |
|
| 74 | 74 | } |
| 75 | 75 | if (in_array(ControllerUpdateInterface::class, $classInterfaces) === true) { |
| 76 | - $group->patch($type . $indexSlug, $handler(CI::METHOD_UPDATE), $params(CI::METHOD_UPDATE)); |
|
| 76 | + $group->patch($type.$indexSlug, $handler(CI::METHOD_UPDATE), $params(CI::METHOD_UPDATE)); |
|
| 77 | 77 | } |
| 78 | 78 | if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) { |
| 79 | - $group->delete($type . $indexSlug, $handler(CI::METHOD_DELETE), $params(CI::METHOD_DELETE)); |
|
| 79 | + $group->delete($type.$indexSlug, $handler(CI::METHOD_DELETE), $params(CI::METHOD_DELETE)); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | return $group; |
@@ -91,11 +91,11 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | protected static function controller(GroupInterface $group, string $subUri, string $controllerClass): GroupInterface |
| 93 | 93 | { |
| 94 | - $slugged = $subUri . '/{' . CI::ROUTE_KEY_INDEX . '}'; |
|
| 95 | - $params = function ($method) use ($subUri) { |
|
| 96 | - return [RouteInterface::PARAM_NAME => $subUri . '_' . $method]; |
|
| 94 | + $slugged = $subUri.'/{'.CI::ROUTE_KEY_INDEX.'}'; |
|
| 95 | + $params = function($method) use ($subUri) { |
|
| 96 | + return [RouteInterface::PARAM_NAME => $subUri.'_'.$method]; |
|
| 97 | 97 | }; |
| 98 | - $handler = function ($method) use ($controllerClass) { |
|
| 98 | + $handler = function($method) use ($controllerClass) { |
|
| 99 | 99 | return [$controllerClass, $method]; |
| 100 | 100 | }; |
| 101 | 101 | |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | $group->get($slugged, $handler(CI::METHOD_READ), $params(CI::METHOD_READ)); |
| 113 | 113 | } |
| 114 | 114 | if (in_array(ControllerUpdateInterface::class, $classInterfaces) === true) { |
| 115 | - $updateUri = $slugged . '/' . CI::METHOD_UPDATE; |
|
| 115 | + $updateUri = $slugged.'/'.CI::METHOD_UPDATE; |
|
| 116 | 116 | $group->post($updateUri, $handler(CI::METHOD_UPDATE), $params(CI::METHOD_UPDATE)); |
| 117 | 117 | } |
| 118 | 118 | if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) { |
| 119 | - $deleteUri = $slugged . '/' . CI::METHOD_DELETE; |
|
| 119 | + $deleteUri = $slugged.'/'.CI::METHOD_DELETE; |
|
| 120 | 120 | $group->post($deleteUri, $handler(CI::METHOD_DELETE), $params(CI::METHOD_DELETE)); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -148,13 +148,13 @@ discard block |
||
| 148 | 148 | /** @var string $controllerClass */ |
| 149 | 149 | /** @var string $schemaClass */ |
| 150 | 150 | |
| 151 | - $resourceIdUri = $subUri . '/{' . CI::ROUTE_KEY_INDEX . '}/'; |
|
| 152 | - $selfUri = $resourceIdUri . DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $relationshipName; |
|
| 151 | + $resourceIdUri = $subUri.'/{'.CI::ROUTE_KEY_INDEX.'}/'; |
|
| 152 | + $selfUri = $resourceIdUri.DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$relationshipName; |
|
| 153 | 153 | |
| 154 | 154 | return $group |
| 155 | 155 | // `self` |
| 156 | 156 | ->get($selfUri, [$controllerClass, $selfGetMethod]) |
| 157 | 157 | // `related` |
| 158 | - ->get($resourceIdUri . $relationshipName, [$controllerClass, $selfGetMethod]); |
|
| 158 | + ->get($resourceIdUri.$relationshipName, [$controllerClass, $selfGetMethod]); |
|
| 159 | 159 | } |
| 160 | 160 | } |
@@ -52,17 +52,17 @@ |
||
| 52 | 52 | public function withIncludes(iterable $includes): self; |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * @return iterable |
|
| 55 | + * @return \Generator |
|
| 56 | 56 | */ |
| 57 | 57 | public function getMappedFilters(): iterable; |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * @return iterable |
|
| 60 | + * @return \Generator |
|
| 61 | 61 | */ |
| 62 | 62 | public function getMappedSorts(): iterable; |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * @return iterable |
|
| 65 | + * @return \Generator |
|
| 66 | 66 | */ |
| 67 | 67 | public function getMappedIncludes(): iterable; |
| 68 | 68 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | public function areFiltersWithAnd(): bool; |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * @return iterable |
|
| 45 | + * @return \Generator |
|
| 46 | 46 | */ |
| 47 | 47 | public function getFilters(): iterable; |
| 48 | 48 | |