Skip to content

Commit 84a7b2d

Browse files
Fix styling
1 parent 0474c6c commit 84a7b2d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Node/ComponentNode.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,19 @@ public function getDynamicComponent()
9494
if ($value->hasAttribute('value')) {
9595
// Returns the component string value
9696
$component = '\'' . $value->getAttribute('value') . '\'';
97+
9798
break;
9899
}
99100

100101
if ($value->hasAttribute('name')) {
101102
// Uses the context to get the component value
102103
$component = '($context[\'' . $value->getAttribute('name') . '\'] ?? null)';
104+
103105
break;
104106
}
105107
}
106108

107-
if (!$component) {
109+
if (! $component) {
108110
throw new Exception('Dynamic component must have a component attribute');
109111
}
110112

@@ -127,6 +129,7 @@ public static function parseDynamicComponent($path, $component)
127129
// Strip anything from the path before the dynamic component name, so it begins with the namespace
128130
$dynamicComponentEndPosition = strpos($path, self::DYNAMIC_COMPONENT_NAME) + strlen(self::DYNAMIC_COMPONENT_NAME);
129131
$pathEnd = substr($path, $dynamicComponentEndPosition);
132+
130133
return $component . $pathEnd;
131134
}
132135

@@ -182,7 +185,7 @@ protected function addTemplateArguments(Compiler $compiler)
182185

183186
public function filterVariables()
184187
{
185-
if (!$this->isDynamicComponent()) {
188+
if (! $this->isDynamicComponent()) {
186189
return;
187190
}
188191

tests/GlobalContextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Performing\TwigComponents\Tests;
44

55
use Performing\TwigComponents\Configuration;
6-
use PHPUnit\Framework\TestCase;
76
use PHPUnit\Framework\Attributes\Test;
7+
use PHPUnit\Framework\TestCase;
88

99
class GlobalContextTest extends TestCase
1010
{

0 commit comments

Comments
 (0)