@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function boot(Container $container, FinalizerInterface $finalizer): void |
53 | 53 | { |
54 | 54 | $finalizer->addFinalizer(function () use ($container): void { |
55 | - if ($container->hasInstance(ORMInterface::class)) { |
|
55 | + if ($container->hasInstance(ORMInterface::class)){ |
|
56 | 56 | $container->get(ORMInterface::class)->getHeap()->clean(); |
57 | 57 | } |
58 | 58 | }); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ): ORMInterface { |
74 | 74 | $orm = new ORM($factory, $schema); |
75 | 75 | |
76 | - if ($promiseFactory !== null) { |
|
76 | + if ($promiseFactory !== null){ |
|
77 | 77 | return $orm->withPromiseFactory($promiseFactory); |
78 | 78 | } |
79 | 79 |
@@ -52,7 +52,8 @@ discard block |
||
52 | 52 | public function boot(Container $container, FinalizerInterface $finalizer): void |
53 | 53 | { |
54 | 54 | $finalizer->addFinalizer(function () use ($container): void { |
55 | - if ($container->hasInstance(ORMInterface::class)) { |
|
55 | + if ($container->hasInstance(ORMInterface::class)) |
|
56 | + { |
|
56 | 57 | $container->get(ORMInterface::class)->getHeap()->clean(); |
57 | 58 | } |
58 | 59 | }); |
@@ -73,7 +74,8 @@ discard block |
||
73 | 74 | ): ORMInterface { |
74 | 75 | $orm = new ORM($factory, $schema); |
75 | 76 | |
76 | - if ($promiseFactory !== null) { |
|
77 | + if ($promiseFactory !== null) |
|
78 | + { |
|
77 | 79 | return $orm->withPromiseFactory($promiseFactory); |
78 | 80 | } |
79 | 81 |
@@ -38,9 +38,9 @@ |
||
38 | 38 | public function createInjection(\ReflectionClass $class, string $context = null) |
39 | 39 | { |
40 | 40 | $schema = $this->orm->getSchema(); |
41 | - foreach ($schema->getRoles() as $role) { |
|
41 | + foreach ($schema->getRoles() as $role){ |
|
42 | 42 | $repository = $schema->define($role, Schema::REPOSITORY); |
43 | - if ($repository !== Select\Repository::class && $repository === $class->getName()) { |
|
43 | + if ($repository !== Select\Repository::class && $repository === $class->getName()){ |
|
44 | 44 | return $this->orm->getRepository($role); |
45 | 45 | } |
46 | 46 | } |
@@ -38,9 +38,11 @@ |
||
38 | 38 | public function createInjection(\ReflectionClass $class, string $context = null) |
39 | 39 | { |
40 | 40 | $schema = $this->orm->getSchema(); |
41 | - foreach ($schema->getRoles() as $role) { |
|
41 | + foreach ($schema->getRoles() as $role) |
|
42 | + { |
|
42 | 43 | $repository = $schema->define($role, Schema::REPOSITORY); |
43 | - if ($repository !== Select\Repository::class && $repository === $class->getName()) { |
|
44 | + if ($repository !== Select\Repository::class && $repository === $class->getName()) |
|
45 | + { |
|
44 | 46 | return $this->orm->getRepository($role); |
45 | 47 | } |
46 | 48 | } |
@@ -29,9 +29,9 @@ |
||
29 | 29 | */ |
30 | 30 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
31 | 31 | { |
32 | - if ($this->isJsonPayload($request)) { |
|
32 | + if ($this->isJsonPayload($request)){ |
|
33 | 33 | $request = $request->withParsedBody(json_decode((string)$request->getBody(), true)); |
34 | - if (json_last_error() !== 0) { |
|
34 | + if (json_last_error() !== 0){ |
|
35 | 35 | throw new ClientException(400, 'invalid json payload'); |
36 | 36 | } |
37 | 37 | } |
@@ -29,9 +29,11 @@ |
||
29 | 29 | */ |
30 | 30 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
31 | 31 | { |
32 | - if ($this->isJsonPayload($request)) { |
|
32 | + if ($this->isJsonPayload($request)) |
|
33 | + { |
|
33 | 34 | $request = $request->withParsedBody(json_decode((string)$request->getBody(), true)); |
34 | - if (json_last_error() !== 0) { |
|
35 | + if (json_last_error() !== 0) |
|
36 | + { |
|
35 | 37 | throw new ClientException(400, 'invalid json payload'); |
36 | 38 | } |
37 | 39 | } |