@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | protected function setErrorHandler(): self |
44 | 44 | { |
45 | - set_error_handler(function ($severity, $message, $file, $line) { |
|
45 | + set_error_handler(function($severity, $message, $file, $line) { |
|
46 | 46 | $log = $message.' in '.$file.':'.$line; |
47 | 47 | |
48 | 48 | switch ($severity) { |
@@ -184,7 +184,7 @@ |
||
184 | 184 | */ |
185 | 185 | protected function setExceptionHandler(): self |
186 | 186 | { |
187 | - set_exception_handler(function ($e) { |
|
187 | + set_exception_handler(function($e) { |
|
188 | 188 | $this->logger->emergency('uncaught exception: '.$e->getMessage(), [ |
189 | 189 | 'category' => get_class($this), |
190 | 190 | 'exception' => $e, |
@@ -51,7 +51,7 @@ |
||
51 | 51 | */ |
52 | 52 | protected static function setErrorHandler(LoggerInterface $logger): void |
53 | 53 | { |
54 | - set_error_handler(function ($severity, $message, $file, $line) use ($logger) { |
|
54 | + set_error_handler(function($severity, $message, $file, $line) use ($logger) { |
|
55 | 55 | $log = $message.' in '.$file.':'.$line; |
56 | 56 | |
57 | 57 | switch ($severity) { |
@@ -54,7 +54,7 @@ |
||
54 | 54 | */ |
55 | 55 | protected function setErrorHandler(LoggerInterface $logger): self |
56 | 56 | { |
57 | - set_error_handler(function ($severity, $message, $file, $line) use ($logger) { |
|
57 | + set_error_handler(function($severity, $message, $file, $line) use ($logger) { |
|
58 | 58 | $log = $message.' in '.$file.':'.$line; |
59 | 59 | |
60 | 60 | switch ($severity) { |
@@ -100,7 +100,7 @@ |
||
100 | 100 | if ($handler instanceof MongoDBHandler) { |
101 | 101 | $handler->setLevel($level); |
102 | 102 | |
103 | - $this->logger->pushProcessor(function ($record) use ($context) { |
|
103 | + $this->logger->pushProcessor(function($record) use ($context) { |
|
104 | 104 | $record['context'] = array_merge($record['context'], $context); |
105 | 105 | |
106 | 106 | return $record; |
@@ -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 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | public function watchFrom(Collection $collection, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = [], ?Closure $build = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
171 | 171 | { |
172 | 172 | if ($build === null) { |
173 | - $build = function ($resource) { |
|
173 | + $build = function($resource) { |
|
174 | 174 | return $this->build($resource); |
175 | 175 | }; |
176 | 176 | } |
@@ -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 | } |
@@ -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']); |