@@ -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 | } |
@@ -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 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | $object = $this->object; |
53 | 53 | |
54 | 54 | if ($object !== null) { |
55 | - $resource['status']['object'] = function () use ($object, $request) { |
|
55 | + $resource['status']['object'] = function() use ($object, $request) { |
|
56 | 56 | return $object->decorate($request); |
57 | 57 | }; |
58 | 58 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | ]; |
67 | 67 | } |
68 | 68 | |
69 | - return $this->getAllFrom($this->db->{$this->scheduler->getJobQueue()}, $filter, $offset, $limit, $sort, function (array $resource) use ($namespace) { |
|
69 | + return $this->getAllFrom($this->db->{$this->scheduler->getJobQueue()}, $filter, $offset, $limit, $sort, function(array $resource) use ($namespace) { |
|
70 | 70 | return $this->build($resource, $namespace); |
71 | 71 | }); |
72 | 72 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function watch(ResourceNamespaceInterface $namespace, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
111 | 111 | { |
112 | - return $this->watchFrom($this->db->{$this->scheduler->getJobQueue()}, $after, $existing, $query, function (array $resource) use ($namespace) { |
|
112 | + return $this->watchFrom($this->db->{$this->scheduler->getJobQueue()}, $after, $existing, $query, function(array $resource) use ($namespace) { |
|
113 | 113 | return $this->build($resource, $namespace); |
114 | 114 | }, $offset, $limit, $sort); |
115 | 115 | } |