Passed
Push — master ( e2b43f...ae602f )
by butschster
04:24 queued 18s
created
src/Framework/Bootloader/DebugBootloader.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function __construct(
31 31
         private readonly FactoryInterface $factory
32
-    ) {
32
+    ){
33 33
     }
34 34
 
35 35
     /**
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     /**
44 44
      * @psalm-param class-string<StateCollectorInterface>|StateCollectorInterface $collector
45 45
      */
46
-    public function addStateCollector(string|StateCollectorInterface $collector): void
46
+    public function addStateCollector(string | StateCollectorInterface $collector): void
47 47
     {
48 48
         $this->collectors[] = $collector;
49 49
     }
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
     {
56 56
         $state = new State();
57 57
 
58
-        foreach ($this->collectors as $collector) {
58
+        foreach ($this->collectors as $collector){
59 59
             $collector = match (true) {
60 60
                 \is_string($collector) => $this->factory->make($collector),
61 61
                 $collector instanceof Autowire => $collector->resolve($this->factory),
62 62
                 default => $collector,
63 63
             };
64 64
 
65
-            if (!$collector instanceof StateCollectorInterface) {
65
+            if (!$collector instanceof StateCollectorInterface){
66 66
                 throw new StateException(
67 67
                     \sprintf(
68 68
                         'Unable to populate state, invalid state collector %s',
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,14 +55,16 @@
 block discarded – undo
55 55
     {
56 56
         $state = new State();
57 57
 
58
-        foreach ($this->collectors as $collector) {
58
+        foreach ($this->collectors as $collector)
59
+        {
59 60
             $collector = match (true) {
60 61
                 \is_string($collector) => $this->factory->make($collector),
61 62
                 $collector instanceof Autowire => $collector->resolve($this->factory),
62 63
                 default => $collector,
63 64
             };
64 65
 
65
-            if (!$collector instanceof StateCollectorInterface) {
66
+            if (!$collector instanceof StateCollectorInterface)
67
+            {
66 68
                 throw new StateException(
67 69
                     \sprintf(
68 70
                         'Unable to populate state, invalid state collector %s',
Please login to merge, or discard this patch.
src/Framework/Bootloader/CommandBootloader.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,19 +41,19 @@
 block discarded – undo
41 41
 
42 42
     private function configureExtensions(ConsoleBootloader $console, ContainerInterface $container): void
43 43
     {
44
-        if ($container->has(TranslatorInterface::class)) {
44
+        if ($container->has(TranslatorInterface::class)){
45 45
             $this->configureTranslator($console);
46 46
         }
47 47
 
48
-        if ($container->has(ViewsInterface::class)) {
48
+        if ($container->has(ViewsInterface::class)){
49 49
             $this->configureViews($console);
50 50
         }
51 51
 
52
-        if ($container->has(EncryptionInterface::class)) {
52
+        if ($container->has(EncryptionInterface::class)){
53 53
             $this->configureEncrypter($console);
54 54
         }
55 55
 
56
-        if ($container->has(RouterInterface::class)) {
56
+        if ($container->has(RouterInterface::class)){
57 57
             $console->addCommand(Router\ListCommand::class);
58 58
         }
59 59
     }
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,19 +41,23 @@
 block discarded – undo
41 41
 
42 42
     private function configureExtensions(ConsoleBootloader $console, ContainerInterface $container): void
43 43
     {
44
-        if ($container->has(TranslatorInterface::class)) {
44
+        if ($container->has(TranslatorInterface::class))
45
+        {
45 46
             $this->configureTranslator($console);
46 47
         }
47 48
 
48
-        if ($container->has(ViewsInterface::class)) {
49
+        if ($container->has(ViewsInterface::class))
50
+        {
49 51
             $this->configureViews($console);
50 52
         }
51 53
 
52
-        if ($container->has(EncryptionInterface::class)) {
54
+        if ($container->has(EncryptionInterface::class))
55
+        {
53 56
             $this->configureEncrypter($console);
54 57
         }
55 58
 
56
-        if ($container->has(RouterInterface::class)) {
59
+        if ($container->has(RouterInterface::class))
60
+        {
57 61
             $console->addCommand(Router\ListCommand::class);
58 62
         }
59 63
     }
Please login to merge, or discard this patch.
src/Framework/Bootloader/Http/HttpBootloader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
     public function __construct(
30 30
         private readonly ConfiguratorInterface $config
31
-    ) {
31
+    ){
32 32
     }
33 33
 
34 34
     public function init(): void
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @psalm-param MiddlewareInterface|Autowire|class-string<MiddlewareInterface> Middleware definition
54 54
      */
55
-    public function addMiddleware(string|Autowire|MiddlewareInterface $middleware): void
55
+    public function addMiddleware(string | Autowire | MiddlewareInterface $middleware): void
56 56
     {
57 57
         $this->config->modify(HttpConfig::CONFIG, new Append('middleware', null, $middleware));
58 58
     }
Please login to merge, or discard this patch.
src/Framework/Bootloader/Http/RoutesBootloader.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 {
17 17
     public function init(HttpBootloader $http): void
18 18
     {
19
-        foreach ($this->globalMiddleware() as $middleware) {
19
+        foreach ($this->globalMiddleware() as $middleware){
20 20
             $http->addMiddleware($middleware);
21 21
         }
22 22
     }
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 
51 51
     private function registerMiddlewareGroups(BinderInterface $binder, array $groups): void
52 52
     {
53
-        foreach ($groups as $group => $middleware) {
53
+        foreach ($groups as $group => $middleware){
54 54
             $binder->bind(
55
-                'middleware:' . $group,
55
+                'middleware:'.$group,
56 56
                 static function (PipelineFactory $factory) use ($middleware): Pipeline {
57 57
                     return $factory->createWithMiddleware($middleware);
58 58
                 }
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 
63 63
     private function registerMiddlewareForRouteGroups(GroupRegistry $registry, array $groups): void
64 64
     {
65
-        foreach ($groups as $group) {
66
-            $registry->getGroup($group)->addMiddleware('middleware:' . $group);
65
+        foreach ($groups as $group){
66
+            $registry->getGroup($group)->addMiddleware('middleware:'.$group);
67 67
         }
68 68
     }
69 69
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,8 @@  discard block
 block discarded – undo
16 16
 {
17 17
     public function init(HttpBootloader $http): void
18 18
     {
19
-        foreach ($this->globalMiddleware() as $middleware) {
19
+        foreach ($this->globalMiddleware() as $middleware)
20
+        {
20 21
             $http->addMiddleware($middleware);
21 22
         }
22 23
     }
@@ -50,7 +51,8 @@  discard block
 block discarded – undo
50 51
 
51 52
     private function registerMiddlewareGroups(BinderInterface $binder, array $groups): void
52 53
     {
53
-        foreach ($groups as $group => $middleware) {
54
+        foreach ($groups as $group => $middleware)
55
+        {
54 56
             $binder->bind(
55 57
                 'middleware:' . $group,
56 58
                 static function (PipelineFactory $factory) use ($middleware): Pipeline {
@@ -62,7 +64,8 @@  discard block
 block discarded – undo
62 64
 
63 65
     private function registerMiddlewareForRouteGroups(GroupRegistry $registry, array $groups): void
64 66
     {
65
-        foreach ($groups as $group) {
67
+        foreach ($groups as $group)
68
+        {
66 69
             $registry->getGroup($group)->addMiddleware('middleware:' . $group);
67 70
         }
68 71
     }
Please login to merge, or discard this patch.
src/Framework/Bootloader/Http/JsonPayloadsBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 {
13 13
     public function __construct(
14 14
         private readonly ConfiguratorInterface $config
15
-    ) {
15
+    ){
16 16
     }
17 17
 
18 18
     public function init(HttpBootloader $http): void
Please login to merge, or discard this patch.
src/Framework/Framework/Kernel.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function appBooting(\Closure ...$callbacks): void
38 38
     {
39
-        foreach ($callbacks as $callback) {
39
+        foreach ($callbacks as $callback){
40 40
             $this->bootingCallbacks[] = $callback;
41 41
         }
42 42
     }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function appBooted(\Closure ...$callbacks): void
53 53
     {
54
-        foreach ($callbacks as $callback) {
54
+        foreach ($callbacks as $callback){
55 55
             $this->bootedCallbacks[] = $callback;
56 56
         }
57 57
     }
@@ -89,29 +89,29 @@  discard block
 block discarded – undo
89 89
      */
90 90
     protected function mapDirectories(array $directories): array
91 91
     {
92
-        if (!isset($directories['root'])) {
92
+        if (!isset($directories['root'])){
93 93
             throw new BootException('Missing required directory `root`');
94 94
         }
95 95
 
96
-        if (!isset($directories['app'])) {
97
-            $directories['app'] = $directories['root'] . '/app/';
96
+        if (!isset($directories['app'])){
97
+            $directories['app'] = $directories['root'].'/app/';
98 98
         }
99 99
 
100 100
         return \array_merge(
101 101
             [
102 102
                 // public root
103
-                'public'    => $directories['root'] . '/public/',
103
+                'public'    => $directories['root'].'/public/',
104 104
 
105 105
                 // vendor libraries
106
-                'vendor'    => $directories['root'] . '/vendor/',
106
+                'vendor'    => $directories['root'].'/vendor/',
107 107
 
108 108
                 // data directories
109
-                'runtime'   => $directories['root'] . '/runtime/',
110
-                'cache'     => $directories['root'] . '/runtime/cache/',
109
+                'runtime'   => $directories['root'].'/runtime/',
110
+                'cache'     => $directories['root'].'/runtime/cache/',
111 111
 
112 112
                 // application directories
113
-                'config'    => $directories['app'] . '/config/',
114
-                'resources' => $directories['app'] . '/resources/',
113
+                'config'    => $directories['app'].'/config/',
114
+                'resources' => $directories['app'].'/resources/',
115 115
             ],
116 116
             $directories
117 117
         );
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function appBooting(\Closure ...$callbacks): void
38 38
     {
39
-        foreach ($callbacks as $callback) {
39
+        foreach ($callbacks as $callback)
40
+        {
40 41
             $this->bootingCallbacks[] = $callback;
41 42
         }
42 43
     }
@@ -51,7 +52,8 @@  discard block
 block discarded – undo
51 52
      */
52 53
     public function appBooted(\Closure ...$callbacks): void
53 54
     {
54
-        foreach ($callbacks as $callback) {
55
+        foreach ($callbacks as $callback)
56
+        {
55 57
             $this->bootedCallbacks[] = $callback;
56 58
         }
57 59
     }
@@ -89,11 +91,13 @@  discard block
 block discarded – undo
89 91
      */
90 92
     protected function mapDirectories(array $directories): array
91 93
     {
92
-        if (!isset($directories['root'])) {
94
+        if (!isset($directories['root']))
95
+        {
93 96
             throw new BootException('Missing required directory `root`');
94 97
         }
95 98
 
96
-        if (!isset($directories['app'])) {
99
+        if (!isset($directories['app']))
100
+        {
97 101
             $directories['app'] = $directories['root'] . '/app/';
98 102
         }
99 103
 
Please login to merge, or discard this patch.
src/Framework/Http/PaginationFactory.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     public function __construct(
21 21
         private readonly ContainerInterface $container,
22 22
         private readonly FactoryInterface $factory
23
-    ) {
23
+    ){
24 24
     }
25 25
 
26 26
     /**
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function createPaginator(string $parameter, int $limit = 25): PaginatorInterface
30 30
     {
31
-        if (!$this->container->has(ServerRequestInterface::class)) {
31
+        if (!$this->container->has(ServerRequestInterface::class)){
32 32
             throw new ScopeException('Unable to create paginator, no request scope found');
33 33
         }
34 34
         /**
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         //Getting page number
40 40
         $page = 0;
41
-        if (!empty($query[$parameter]) && \is_scalar($query[$parameter])) {
41
+        if (!empty($query[$parameter]) && \is_scalar($query[$parameter])){
42 42
             $page = (int)$query[$parameter];
43 43
         }
44 44
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function createPaginator(string $parameter, int $limit = 25): PaginatorInterface
30 30
     {
31
-        if (!$this->container->has(ServerRequestInterface::class)) {
31
+        if (!$this->container->has(ServerRequestInterface::class))
32
+        {
32 33
             throw new ScopeException('Unable to create paginator, no request scope found');
33 34
         }
34 35
         /**
@@ -38,7 +39,8 @@  discard block
 block discarded – undo
38 39
 
39 40
         //Getting page number
40 41
         $page = 0;
41
-        if (!empty($query[$parameter]) && \is_scalar($query[$parameter])) {
42
+        if (!empty($query[$parameter]) && \is_scalar($query[$parameter]))
43
+        {
42 44
             $page = (int)$query[$parameter];
43 45
         }
44 46
 
Please login to merge, or discard this patch.
src/Http/tests/PipelineTest.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $pipeline = new Pipeline(new Container());
27 27
 
28
-        $handler = new CallableHandler(function () {
28
+        $handler = new CallableHandler(function (){
29 29
             return 'response';
30 30
         }, new ResponseFactory(new HttpConfig(['headers' => []])));
31 31
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     {
41 41
         $pipeline = new Pipeline(new Container());
42 42
 
43
-        $handler = new CallableHandler(function () {
43
+        $handler = new CallableHandler(function (){
44 44
             return 'response';
45 45
         }, new ResponseFactory(new HttpConfig(['headers' => []])));
46 46
 
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function testMiddlewareProcessingEventShouldBeDispatched(): void
63 63
     {
64
-        $middleware = new class implements MiddlewareInterface {
64
+        $middleware = new class implements MiddlewareInterface{
65 65
             public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
66 66
             {
67 67
                 return (new ResponseFactory(new HttpConfig(['headers' => []])))->createResponse(200);
68 68
             }
69 69
         };
70 70
         $request = new ServerRequest('GET', '');
71
-        $handler = new CallableHandler(function () {
71
+        $handler = new CallableHandler(function (){
72 72
             return 'response';
73 73
         }, new ResponseFactory(new HttpConfig(['headers' => []])));
74 74
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $pipeline = new Pipeline(new Container());
27 27
 
28
-        $handler = new CallableHandler(function () {
28
+        $handler = new CallableHandler(function ()
29
+        {
29 30
             return 'response';
30 31
         }, new ResponseFactory(new HttpConfig(['headers' => []])));
31 32
 
@@ -40,7 +41,8 @@  discard block
 block discarded – undo
40 41
     {
41 42
         $pipeline = new Pipeline(new Container());
42 43
 
43
-        $handler = new CallableHandler(function () {
44
+        $handler = new CallableHandler(function ()
45
+        {
44 46
             return 'response';
45 47
         }, new ResponseFactory(new HttpConfig(['headers' => []])));
46 48
 
@@ -61,14 +63,16 @@  discard block
 block discarded – undo
61 63
 
62 64
     public function testMiddlewareProcessingEventShouldBeDispatched(): void
63 65
     {
64
-        $middleware = new class implements MiddlewareInterface {
66
+        $middleware = new class implements MiddlewareInterface
67
+        {
65 68
             public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
66 69
             {
67 70
                 return (new ResponseFactory(new HttpConfig(['headers' => []])))->createResponse(200);
68 71
             }
69 72
         };
70 73
         $request = new ServerRequest('GET', '');
71
-        $handler = new CallableHandler(function () {
74
+        $handler = new CallableHandler(function ()
75
+        {
72 76
             return 'response';
73 77
         }, new ResponseFactory(new HttpConfig(['headers' => []])));
74 78
 
Please login to merge, or discard this patch.
src/Http/src/Exception/ClientException.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@
 block discarded – undo
23 23
      */
24 24
     public function __construct(?int $code = null, string $message = '', ?\Throwable $previous = null)
25 25
     {
26
-        if (empty($code) && empty($this->code)) {
26
+        if (empty($code) && empty($this->code)){
27 27
             $code = self::BAD_DATA;
28 28
         }
29 29
 
30
-        if (empty($message)) {
30
+        if (empty($message)){
31 31
             $message = \sprintf('Http Error - %s', $code);
32 32
         }
33 33
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,11 +23,13 @@
 block discarded – undo
23 23
      */
24 24
     public function __construct(?int $code = null, string $message = '', ?\Throwable $previous = null)
25 25
     {
26
-        if (empty($code) && empty($this->code)) {
26
+        if (empty($code) && empty($this->code))
27
+        {
27 28
             $code = self::BAD_DATA;
28 29
         }
29 30
 
30
-        if (empty($message)) {
31
+        if (empty($message))
32
+        {
31 33
             $message = \sprintf('Http Error - %s', $code);
32 34
         }
33 35
 
Please login to merge, or discard this patch.