@@ -59,7 +59,7 @@ |
||
| 59 | 59 | /** |
| 60 | 60 | * Resolve all references |
| 61 | 61 | * |
| 62 | - * @return mixed The whole definition can be a reference to a scalar value |
|
| 62 | + * @return \stdClass The whole definition can be a reference to a scalar value |
|
| 63 | 63 | */ |
| 64 | 64 | public function resolve() |
| 65 | 65 | { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function getRequestParameters(ServerRequestInterface $httpRequest, Operation $operation): \stdClass |
| 41 | 41 | { |
| 42 | - $indexed = array_combine( |
|
| 42 | + $indexed = array_combine( |
|
| 43 | 43 | explode('/', trim($operation->getPath(), '/')), |
| 44 | 44 | explode('/', trim($httpRequest->getUri()->getPath(), '/')) |
| 45 | 45 | ); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $parameters = (object)[]; |
| 55 | 55 | $queryParams = (object)$httpRequest->getQueryParams(); |
| 56 | 56 | $headers = $httpRequest->getHeaders(); |
| 57 | - $headerParamMap = array_combine(array_map(function ($key) { |
|
| 57 | + $headerParamMap = array_combine(array_map(function($key) { |
|
| 58 | 58 | return $this->getHeaderParameterName($key); |
| 59 | 59 | }, array_keys($headers)), array_keys($headers)); |
| 60 | 60 | |
@@ -90,18 +90,18 @@ discard block |
||
| 90 | 90 | private function getHeaderParameterName($headerName) |
| 91 | 91 | { |
| 92 | 92 | $replacements = [ |
| 93 | - function ($matches) { |
|
| 93 | + function($matches) { |
|
| 94 | 94 | return strtolower($matches[2]); |
| 95 | 95 | }, |
| 96 | - function ($matches) { |
|
| 96 | + function($matches) { |
|
| 97 | 97 | return strtoupper($matches[2]); |
| 98 | 98 | }, |
| 99 | - function ($matches) { |
|
| 99 | + function($matches) { |
|
| 100 | 100 | return strtoupper($matches[1]); |
| 101 | 101 | }, |
| 102 | 102 | ]; |
| 103 | 103 | |
| 104 | - foreach (['/^(X-)?(.*)/i', '/(\-)([\S]{1})/', '/(^[\S]{1})/',] as $index => $pattern) { |
|
| 104 | + foreach (['/^(X-)?(.*)/i', '/(\-)([\S]{1})/', '/(^[\S]{1})/', ] as $index => $pattern) { |
|
| 105 | 105 | $headerName = preg_replace_callback($pattern, $replacements[$index], $headerName); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * @param \stdClass $definition |
| 24 | 24 | * @param string $path |
| 25 | 25 | * @param string $method |
| 26 | - * @param array $pathParameters |
|
| 26 | + * @param Parameter[] $pathParameters |
|
| 27 | 27 | */ |
| 28 | 28 | public function __construct(\stdClass $definition, string $path, string $method, array $pathParameters = []) |
| 29 | 29 | { |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | public function apply(callable $f) |
| 51 | 51 | { |
| 52 | - $recurse = function (&$item, $parent = null, $parentAttribute = null) use ($f, &$recurse) { |
|
| 52 | + $recurse = function(&$item, $parent = null, $parentAttribute = null) use ($f, &$recurse) { |
|
| 53 | 53 | |
| 54 | 54 | foreach ($item as $attribute => &$value) { |
| 55 | 55 | if (false === $f($value, $attribute, $parent, $parentAttribute)) { |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | $document = clone $document; |
| 30 | 30 | |
| 31 | - $document->apply(function ($definition, $attributeName, $parent, $parentAttributeName) { |
|
| 31 | + $document->apply(function($definition, $attributeName, $parent, $parentAttributeName) { |
|
| 32 | 32 | if (substr((string)$attributeName, 0, 1) === '/') { |
| 33 | 33 | $pathName = "{$parentAttributeName}{$attributeName}"; |
| 34 | 34 | $this->paths[$pathName] = new RamlPath($pathName, $definition); |