@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | ]; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($endpoint) { |
|
| 77 | + return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($endpoint) { |
|
| 78 | 78 | return $this->build($resource, $endpoint); |
| 79 | 79 | }); |
| 80 | 80 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function watch(EndpointInterface $endpoint, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 144 | 144 | { |
| 145 | - return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($endpoint) { |
|
| 145 | + return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($endpoint) { |
|
| 146 | 146 | return $this->build($resource, $endpoint); |
| 147 | 147 | }, $offset, $limit, $sort); |
| 148 | 148 | } |
@@ -48,12 +48,12 @@ |
||
| 48 | 48 | 'message' => $this->resource['message'], |
| 49 | 49 | 'created' => (new DateTime($this->resource['datetime']))->format('c'), |
| 50 | 50 | 'category' => $this->resource['context']['category'], |
| 51 | - 'exception' => function ($resource) use ($data) { |
|
| 51 | + 'exception' => function($resource) use ($data) { |
|
| 52 | 52 | if (isset($data['context']['exception'])) { |
| 53 | 53 | return $data['context']['exception']; |
| 54 | 54 | } |
| 55 | 55 | }, |
| 56 | - 'object' => function ($resource) use ($data) { |
|
| 56 | + 'object' => function($resource) use ($data) { |
|
| 57 | 57 | if (isset($data['context']['object'])) { |
| 58 | 58 | return $data['context']['object']; |
| 59 | 59 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | public function getAllFrom(Collection $collection, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null, ?Closure $build = null): Generator |
| 144 | 144 | { |
| 145 | 145 | if ($build === null) { |
| 146 | - $build = function ($resource) { |
|
| 146 | + $build = function($resource) { |
|
| 147 | 147 | return $this->build($resource); |
| 148 | 148 | }; |
| 149 | 149 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | { |
| 176 | 176 | //$this->logger->debug("PIPE WATCH"); |
| 177 | 177 | if ($build === null) { |
| 178 | - $build = function ($resource) { |
|
| 178 | + $build = function($resource) { |
|
| 179 | 179 | return $this->build($resource); |
| 180 | 180 | }; |
| 181 | 181 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | 'namespace' => $namespace, |
| 191 | 191 | 'collection' => $collection, |
| 192 | 192 | 'data' => $this->getData(), |
| 193 | - 'status' => function ($endpoint) { |
|
| 193 | + 'status' => function($endpoint) { |
|
| 194 | 194 | try { |
| 195 | 195 | $endpoint->setup(); |
| 196 | 196 | |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | */ |
| 345 | 345 | private function parseAttribute(string $string, array $data): string |
| 346 | 346 | { |
| 347 | - return preg_replace_callback('/(\{(([^\}\"]*)+)\})(\}?)/', function ($match) use ($string, $data) { |
|
| 347 | + return preg_replace_callback('/(\{(([^\}\"]*)+)\})(\}?)/', function($match) use ($string, $data) { |
|
| 348 | 348 | if (substr($match[0], 0, 2) === '{{' && $match[4][0] === '}') { |
| 349 | 349 | return $match[2].$match[4]; |
| 350 | 350 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ]; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($collection) { |
|
| 83 | + return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($collection) { |
|
| 84 | 84 | return $this->build($resource, $collection); |
| 85 | 85 | }); |
| 86 | 86 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function watch(CollectionInterface $collection, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 159 | 159 | { |
| 160 | - return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($collection) { |
|
| 160 | + return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($collection) { |
|
| 161 | 161 | return $this->build($resource, $collection); |
| 162 | 162 | }, $offset, $limit, $sort); |
| 163 | 163 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public static function collect() |
| 22 | 22 | { |
| 23 | - return FastRoute\simpleDispatcher(function (FastRoute\RouteCollector $r) { |
|
| 23 | + return FastRoute\simpleDispatcher(function(FastRoute\RouteCollector $r) { |
|
| 24 | 24 | $r->addRoute('GET', '/api/v1', [v1\Api::class, 'get']); |
| 25 | 25 | $r->addRoute('GET', '/spec/api/v1', [Specifications::class, 'getApiv1']); |
| 26 | 26 | $r->addRoute('GET', '/api/v1/namespaces', [v1\ResourceNamespaces::class, 'getAll']); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | 'namespace' => $namespace, |
| 64 | 64 | 'collection' => $collection, |
| 65 | 65 | 'data' => $this->getData(), |
| 66 | - 'status' => function ($object) { |
|
| 66 | + 'status' => function($object) { |
|
| 67 | 67 | $endpoints = $object->getEndpoints(); |
| 68 | 68 | foreach ($endpoints as &$endpoint) { |
| 69 | 69 | $endpoint['last_sync'] = $endpoint['last_sync']->toDateTime()->format('c'); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | ]; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($namespace) { |
|
| 82 | + return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($namespace) { |
|
| 83 | 83 | return $this->build($resource, $namespace); |
| 84 | 84 | }); |
| 85 | 85 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function watch(ResourceNamespaceInterface $namespace, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 145 | 145 | { |
| 146 | - return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($namespace) { |
|
| 146 | + return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($namespace) { |
|
| 147 | 147 | return $this->build($resource, $namespace); |
| 148 | 148 | }, $offset, $limit, $sort); |
| 149 | 149 | } |
@@ -46,5 +46,5 @@ |
||
| 46 | 46 | /** |
| 47 | 47 | * Switch namespace. |
| 48 | 48 | */ |
| 49 | - public function switch(string $name): ResourceNamespaceInterface; |
|
| 49 | + public function switch (string $name): ResourceNamespaceInterface; |
|
| 50 | 50 | } |