Passed
Push — master ( 0b27cb...47db47 )
by Aleksei
12:46 queued 02:12
created
src/Stempler/src/Node/Template.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@
 block discarded – undo
24 24
      */
25 25
     public function __construct(
26 26
         public array $nodes = [],
27
-    ) {}
27
+    ) {
28
+}
28 29
 
29 30
     public function setContext(?Context $context = null): void
30 31
     {
Please login to merge, or discard this patch.
src/Stempler/tests/Transform/Import/BundleTest.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,12 +45,14 @@  discard block
 block discarded – undo
45 45
         $builder = new Builder($loader);
46 46
 
47 47
         $builder->addVisitor(
48
-            new class implements VisitorInterface {
48
+            new class implements VisitorInterface
49
+            {
49 50
 
50 51
                 public function enterNode(mixed $node, VisitorContext $ctx): mixed
51 52
                 {
52 53
                     $n = $ctx->getCurrentNode();
53
-                    if ($n instanceof Template) {
54
+                    if ($n instanceof Template)
55
+                    {
54 56
                         $import = m::mock(ImportInterface::class);
55 57
                         $import->shouldNotReceive('resolve');
56 58
                         $n->setAttribute(ImportContext::class, [$import]);
@@ -94,16 +96,19 @@  discard block
 block discarded – undo
94 96
         $template = new Template();
95 97
 
96 98
         $builder->addVisitor(
97
-            new class($builder, $template) implements VisitorInterface {
99
+            new class($builder, $template) implements VisitorInterface
100
+            {
98 101
                 public function __construct(
99 102
                     private readonly Builder $builder,
100 103
                     private readonly Template $template,
101
-                ) {}
104
+                ) {
105
+}
102 106
 
103 107
                 public function enterNode(mixed $node, VisitorContext $ctx): mixed
104 108
                 {
105 109
                     $n = $ctx->getCurrentNode();
106
-                    if ($n instanceof Template) {
110
+                    if ($n instanceof Template)
111
+                    {
107 112
                         $import = m::mock(ImportInterface::class);
108 113
                         $import
109 114
                             ->shouldReceive('resolve')
Please login to merge, or discard this patch.
src/Stempler/src/Transform/Import/Bundle.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,13 +29,16 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function resolve(Builder $builder, string $name): ?Template
31 31
     {
32
-        if ($this->template === null) {
32
+        if ($this->template === null)
33
+        {
33 34
             $this->template = $builder->load($this->path);
34 35
         }
35 36
 
36 37
         $path = $name;
37
-        if ($this->prefix !== null) {
38
-            if (!TagHelper::hasPrefix($name, $this->prefix)) {
38
+        if ($this->prefix !== null)
39
+        {
40
+            if (!TagHelper::hasPrefix($name, $this->prefix))
41
+            {
39 42
                 return null;
40 43
             }
41 44
 
@@ -43,9 +46,11 @@  discard block
 block discarded – undo
43 46
         }
44 47
 
45 48
         /** @var ImportInterface $import */
46
-        foreach ($this->template->getAttribute(ImportContext::class, []) as $import) {
49
+        foreach ($this->template->getAttribute(ImportContext::class, []) as $import)
50
+        {
47 51
             $tpl = $import->resolve($builder, $path);
48
-            if ($tpl !== null) {
52
+            if ($tpl !== null)
53
+            {
49 54
                 return $tpl;
50 55
             }
51 56
         }
Please login to merge, or discard this patch.
src/Stempler/src/Transform/Import/Directory.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@
 block discarded – undo
29 29
 
30 30
     public function resolve(Builder $builder, string $name): ?Template
31 31
     {
32
-        if (!TagHelper::hasPrefix($name, $this->prefix)) {
32
+        if (!TagHelper::hasPrefix($name, $this->prefix))
33
+        {
33 34
             return null;
34 35
         }
35 36
 
Please login to merge, or discard this patch.
src/Stempler/src/Transform/Import/TagHelper.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
     public static function hasPrefix(string $tag, ?string $prefix): bool
20 20
     {
21 21
         // If no prefix is specified, allow everything
22
-        if ($prefix === null || $prefix === '') {
22
+        if ($prefix === null || $prefix === '')
23
+        {
23 24
             return true;
24 25
         }
25 26
 
@@ -27,11 +28,13 @@  discard block
 block discarded – undo
27 28
         //   1) The prefix itself
28 29
         //   2) The separator
29 30
         //   3) At least one more char after the separator
30
-        if (\strlen($tag) < \strlen($prefix) + 2) {
31
+        if (\strlen($tag) < \strlen($prefix) + 2)
32
+        {
31 33
             return false;
32 34
         }
33 35
 
34
-        if (!\str_starts_with($tag, $prefix)) {
36
+        if (!\str_starts_with($tag, $prefix))
37
+        {
35 38
             return false;
36 39
         }
37 40
 
@@ -40,7 +43,8 @@  discard block
 block discarded – undo
40 43
 
41 44
     public static function stripPrefix(string $tag, ?string $prefix): string
42 45
     {
43
-        if (!self::hasPrefix($tag, $prefix)) {
46
+        if (!self::hasPrefix($tag, $prefix))
47
+        {
44 48
             return $tag;
45 49
         }
46 50
 
Please login to merge, or discard this patch.