@@ -109,7 +109,7 @@ |
||
| 109 | 109 | /** |
| 110 | 110 | * {@inheritdoc} |
| 111 | 111 | */ |
| 112 | - public function switch(string $name): ResourceNamespaceInterface |
|
| 112 | + public function switch (string $name): ResourceNamespaceInterface |
|
| 113 | 113 | { |
| 114 | 114 | return $this->namespace_factory->getOne($name); |
| 115 | 115 | } |
@@ -144,7 +144,7 @@ |
||
| 144 | 144 | 'data' => [ |
| 145 | 145 | 'schema' => $this->schema->getSchema(), |
| 146 | 146 | ], |
| 147 | - ]; |
|
| 147 | + ]; |
|
| 148 | 148 | |
| 149 | 149 | return AttributeResolver::resolve($request, $this, $resource); |
| 150 | 150 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | if ($attrv === null || is_string($attrv) && strlen($attrv) === 0 || is_array($attrv) && count($attrv) === 0) { |
| 201 | 201 | if (isset($value['required']) && $value['required'] === false || !isset($value['required'])) { |
| 202 | 202 | $this->logger->debug('found attribute ['.$attr.'] but source attribute is empty, remove attribute from mapping', [ |
| 203 | - 'category' => get_class($this), |
|
| 203 | + 'category' => get_class($this), |
|
| 204 | 204 | ]); |
| 205 | 205 | |
| 206 | 206 | return null; |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | $this->logger->debug('resolved value for attribute ['.$attribute.'] is an array but is not declared as an array, use first array element instead', [ |
| 291 | - 'category' => get_class($this), |
|
| 291 | + 'category' => get_class($this), |
|
| 292 | 292 | ]); |
| 293 | 293 | |
| 294 | 294 | return current($value); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | { |
| 43 | 43 | $resource = [ |
| 44 | 44 | '_links' => [ |
| 45 | - 'self' => ['href' => (string) $request->getUri()], |
|
| 45 | + 'self' => ['href' => (string) $request->getUri()], |
|
| 46 | 46 | ], |
| 47 | 47 | 'kind' => 'DataObjectRelation', |
| 48 | 48 | 'namespace' => $this->resource['namespace'], |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | $request = Zend\Diactoros\ServerRequestFactory::fromGlobals(); |
| 32 | 32 | $logger = $dic->get(Psr\Log\LoggerInterface::class); |
| 33 | 33 | |
| 34 | -set_exception_handler(function ($e) use ($logger) { |
|
| 34 | +set_exception_handler(function($e) use ($logger) { |
|
| 35 | 35 | http_response_code(500); |
| 36 | 36 | $logger->emergency('uncaught exception: '.$e->getMessage(), [ |
| 37 | 37 | 'category' => 'Http', |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | protected function registerFunctions(): void |
| 94 | 94 | { |
| 95 | 95 | $this->crypt = [ |
| 96 | - 'hash' => function ($algo, $data, $raw_output = false) { |
|
| 96 | + 'hash' => function($algo, $data, $raw_output = false) { |
|
| 97 | 97 | return hash($algo, $data, $raw_output); |
| 98 | 98 | }, |
| 99 | 99 | ]; |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | 'kind' => 'Secret', |
| 48 | 48 | 'namespace' => $this->namespace->getName(), |
| 49 | 49 | 'data' => $this->getData(), |
| 50 | - ]; |
|
| 50 | + ]; |
|
| 51 | 51 | |
| 52 | 52 | return AttributeResolver::resolve($request, $this, $resource); |
| 53 | 53 | } |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | 'namespace' => ['href' => (string) $request->getUri()->withPath('/api/v1/namespaces/'.$namespace)], |
| 122 | 122 | 'collection' => ['href' => (string) $request->getUri()->withPath('/api/v1/namespaces/'.$namespace.'/collections/'.$collection)], |
| 123 | 123 | 'endpoint' => ['href' => (string) $request->getUri()->withPath('/api/v1/namespaces/'.$namespace.'/collections/'.$collection.'/endpoints/'.$endpoint)], |
| 124 | - ], |
|
| 124 | + ], |
|
| 125 | 125 | 'namespace' => $namespace, |
| 126 | 126 | 'collection' => $collection, |
| 127 | 127 | 'endpoint' => $endpoint, |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | $that = $this; |
| 103 | 103 | |
| 104 | - return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function (array $resource) use ($that) { |
|
| 104 | + return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function(array $resource) use ($that) { |
|
| 105 | 105 | return $that->build($resource); |
| 106 | 106 | }); |
| 107 | 107 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | { |
| 174 | 174 | $that = $this; |
| 175 | 175 | |
| 176 | - return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($that) { |
|
| 176 | + return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($that) { |
|
| 177 | 177 | return $that->build($resource); |
| 178 | 178 | }, $offset, $limit, $sort); |
| 179 | 179 | } |