Passed
Push — master ( 9f8f80...2ee547 )
by Aleksei
06:30 queued 17s
created
src/Views/src/Engine/AbstractEngine.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
     public function getLoader(): LoaderInterface
30 30
     {
31
-        if (empty($this->loader)) {
31
+        if (empty($this->loader)){
32 32
             throw new EngineException('No associated loader found');
33 33
         }
34 34
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@
 block discarded – undo
28 28
 
29 29
     public function getLoader(): LoaderInterface
30 30
     {
31
-        if (empty($this->loader)) {
31
+        if (empty($this->loader))
32
+        {
32 33
             throw new EngineException('No associated loader found');
33 34
         }
34 35
 
Please login to merge, or discard this patch.
src/Views/src/Engine/Native/NativeEngine.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     public function __construct(
17 17
         private readonly ContainerInterface $container,
18 18
         string $extension = self::EXTENSION
19
-    ) {
19
+    ){
20 20
         $this->extension = $extension;
21 21
     }
22 22
 
Please login to merge, or discard this patch.
src/Views/src/Engine/Native/NativeView.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     public function __construct(
16 16
         private readonly ViewSource $view,
17 17
         private readonly ContainerInterface $container
18
-    ) {
18
+    ){
19 19
     }
20 20
 
21 21
     public function render(array $data = []): string
@@ -23,21 +23,21 @@  discard block
 block discarded – undo
23 23
         \ob_start();
24 24
         $__outputLevel__ = \ob_get_level();
25 25
 
26
-        try {
26
+        try{
27 27
             ContainerScope::runScope($this->container, function () use ($data): void {
28 28
                 \extract($data, EXTR_OVERWRITE);
29 29
                 // render view in context and output buffer scope, context can be accessed using $this->context
30 30
                 require $this->view->getFilename();
31 31
             });
32
-        } catch (\Throwable $throwable) {
33
-            while (\ob_get_level() >= $__outputLevel__) {
32
+        }catch (\Throwable $throwable){
33
+            while (\ob_get_level() >= $__outputLevel__){
34 34
                 \ob_end_clean();
35 35
             }
36 36
 
37 37
             throw new RenderException($throwable);
38
-        } finally {
38
+        }finally{
39 39
             //Closing all nested buffers
40
-            while (\ob_get_level() > $__outputLevel__) {
40
+            while (\ob_get_level() > $__outputLevel__){
41 41
                 \ob_end_clean();
42 42
             }
43 43
         }
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,21 +23,28 @@
 block discarded – undo
23 23
         \ob_start();
24 24
         $__outputLevel__ = \ob_get_level();
25 25
 
26
-        try {
26
+        try
27
+        {
27 28
             ContainerScope::runScope($this->container, function () use ($data): void {
28 29
                 \extract($data, EXTR_OVERWRITE);
29 30
                 // render view in context and output buffer scope, context can be accessed using $this->context
30 31
                 require $this->view->getFilename();
31 32
             });
32
-        } catch (\Throwable $throwable) {
33
-            while (\ob_get_level() >= $__outputLevel__) {
33
+        }
34
+        catch (\Throwable $throwable)
35
+        {
36
+            while (\ob_get_level() >= $__outputLevel__)
37
+            {
34 38
                 \ob_end_clean();
35 39
             }
36 40
 
37 41
             throw new RenderException($throwable);
38
-        } finally {
42
+        }
43
+        finally
44
+        {
39 45
             //Closing all nested buffers
40
-            while (\ob_get_level() > $__outputLevel__) {
46
+            while (\ob_get_level() > $__outputLevel__)
47
+            {
41 48
                 \ob_end_clean();
42 49
             }
43 50
         }
Please login to merge, or discard this patch.
src/Views/src/ViewSource.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
         private readonly string $filename,
16 16
         private readonly string $namespace,
17 17
         private readonly string $name
18
-    ) {
18
+    ){
19 19
     }
20 20
 
21 21
     /**
Please login to merge, or discard this patch.
src/Views/src/Event/ViewNotFound.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,6 +8,6 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct(
10 10
         public readonly string $path,
11
-    ) {
11
+    ){
12 12
     }
13 13
 }
Please login to merge, or discard this patch.
src/Views/src/GlobalVariables.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct(
10 10
         private array $variables = []
11
-    ) {
11
+    ){
12 12
     }
13 13
 
14 14
     public function set(string $name, mixed $data): void
Please login to merge, or discard this patch.
src/Views/src/Bootloader/ViewsBootloader.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function __construct(
36 36
         private readonly ConfiguratorInterface $config
37
-    ) {
37
+    ){
38 38
     }
39 39
 
40 40
     public function init(EnvironmentInterface $env, DirectoriesInterface $dirs, DebugMode $debugMode): void
41 41
     {
42
-        if (!$dirs->has('views')) {
43
-            $dirs->set('views', $dirs->get('app') . 'views');
42
+        if (!$dirs->has('views')){
43
+            $dirs->set('views', $dirs->get('app').'views');
44 44
         }
45 45
 
46 46
         // default view config
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             [
50 50
                 'cache' => [
51 51
                     'enabled' => $env->get('VIEW_CACHE', !$debugMode->isEnabled()),
52
-                    'directory' => $dirs->get('cache') . 'views',
52
+                    'directory' => $dirs->get('cache').'views',
53 53
                 ],
54 54
                 'namespaces' => [
55 55
                     'default' => [$dirs->get('views')],
@@ -62,17 +62,17 @@  discard block
 block discarded – undo
62 62
 
63 63
     public function addDirectory(string $namespace, string $directory): void
64 64
     {
65
-        if (!isset($this->config->getConfig(ViewsConfig::CONFIG)['namespaces'][$namespace])) {
65
+        if (!isset($this->config->getConfig(ViewsConfig::CONFIG)['namespaces'][$namespace])){
66 66
             $this->config->modify(ViewsConfig::CONFIG, new Append('namespaces', $namespace, []));
67 67
         }
68 68
 
69 69
         $this->config->modify(
70 70
             ViewsConfig::CONFIG,
71
-            new Append('namespaces.' . $namespace, null, $directory)
71
+            new Append('namespaces.'.$namespace, null, $directory)
72 72
         );
73 73
     }
74 74
 
75
-    public function addEngine(string|EngineInterface $engine): void
75
+    public function addEngine(string | EngineInterface $engine): void
76 76
     {
77 77
         $this->config->modify(
78 78
             ViewsConfig::CONFIG,
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         );
81 81
     }
82 82
 
83
-    public function addCacheDependency(string|DependencyInterface $dependency): void
83
+    public function addCacheDependency(string | DependencyInterface $dependency): void
84 84
     {
85 85
         $this->config->modify(
86 86
             ViewsConfig::CONFIG,
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
     public function init(EnvironmentInterface $env, DirectoriesInterface $dirs, DebugMode $debugMode): void
41 41
     {
42
-        if (!$dirs->has('views')) {
42
+        if (!$dirs->has('views'))
43
+        {
43 44
             $dirs->set('views', $dirs->get('app') . 'views');
44 45
         }
45 46
 
@@ -62,7 +63,8 @@  discard block
 block discarded – undo
62 63
 
63 64
     public function addDirectory(string $namespace, string $directory): void
64 65
     {
65
-        if (!isset($this->config->getConfig(ViewsConfig::CONFIG)['namespaces'][$namespace])) {
66
+        if (!isset($this->config->getConfig(ViewsConfig::CONFIG)['namespaces'][$namespace]))
67
+        {
66 68
             $this->config->modify(ViewsConfig::CONFIG, new Append('namespaces', $namespace, []));
67 69
         }
68 70
 
Please login to merge, or discard this patch.
src/Hmvc/tests/DemoInterceptor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,6 +11,6 @@
 block discarded – undo
11 11
 {
12 12
     public function process(string $controller, string $action, array $parameters, CoreInterface $core): string
13 13
     {
14
-        return '?' . $core->callAction($controller, $action, $parameters) . '!';
14
+        return '?'.$core->callAction($controller, $action, $parameters).'!';
15 15
     }
16 16
 }
Please login to merge, or discard this patch.
src/Hmvc/tests/InterceptorPipelineTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function testInterceptorCallingEventShouldBeDispatched(): void
17 17
     {
18
-        $interceptor = new class implements CoreInterceptorInterface {
18
+        $interceptor = new class implements CoreInterceptorInterface{
19 19
             public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed
20 20
             {
21 21
                 return null;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $pipeline = new InterceptorPipeline($dispatcher);
32 32
         $pipeline->addInterceptor($interceptor);
33 33
 
34
-        $pipeline->withCore(new class implements CoreInterface {
34
+        $pipeline->withCore(new class implements CoreInterface{
35 35
             public function callAction(string $controller, string $action, array $parameters = []): mixed
36 36
             {
37 37
                 return null;
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,8 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function testInterceptorCallingEventShouldBeDispatched(): void
17 17
     {
18
-        $interceptor = new class implements CoreInterceptorInterface {
18
+        $interceptor = new class implements CoreInterceptorInterface
19
+        {
19 20
             public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed
20 21
             {
21 22
                 return null;
@@ -31,7 +32,8 @@  discard block
 block discarded – undo
31 32
         $pipeline = new InterceptorPipeline($dispatcher);
32 33
         $pipeline->addInterceptor($interceptor);
33 34
 
34
-        $pipeline->withCore(new class implements CoreInterface {
35
+        $pipeline->withCore(new class implements CoreInterface
36
+        {
35 37
             public function callAction(string $controller, string $action, array $parameters = []): mixed
36 38
             {
37 39
                 return null;
Please login to merge, or discard this patch.