@@ -61,15 +61,12 @@ protected function addGetTemplate(Compiler $compiler)
61
61
$ repr = $ this ->isDynamicComponent () ? 'raw ' : 'repr ' ;
62
62
63
63
$ compiler
64
- ->raw ('$this->loadTemplate ( ' . PHP_EOL )
64
+ ->raw ('$this->load ( ' . PHP_EOL )
65
65
->indent (1 )
66
66
->write ('' )
67
67
->$ repr ($ this ->getTemplateName ())
68
68
->raw (', ' . PHP_EOL )
69
69
->write ('' )
70
- ->$ repr ($ this ->getTemplateName ())
71
- ->raw (', ' . PHP_EOL )
72
- ->write ('' )
73
70
->repr ($ this ->getTemplateLine ())
74
71
->indent (-1 )
75
72
->raw (PHP_EOL . '); ' . PHP_EOL . PHP_EOL );
@@ -97,17 +94,19 @@ public function getDynamicComponent()
97
94
if ($ value ->hasAttribute ('value ' )) {
98
95
// Returns the component string value
99
96
$ component = '\'' . $ value ->getAttribute ('value ' ) . '\'' ;
97
+
100
98
break ;
101
99
}
102
100
103
101
if ($ value ->hasAttribute ('name ' )) {
104
102
// Uses the context to get the component value
105
103
$ component = '($context[ \'' . $ value ->getAttribute ('name ' ) . '\'] ?? null) ' ;
104
+
106
105
break ;
107
106
}
108
107
}
109
108
110
- if (!$ component ) {
109
+ if (! $ component ) {
111
110
throw new Exception ('Dynamic component must have a component attribute ' );
112
111
}
113
112
@@ -130,6 +129,7 @@ public static function parseDynamicComponent($path, $component)
130
129
// Strip anything from the path before the dynamic component name, so it begins with the namespace
131
130
$ dynamicComponentEndPosition = strpos ($ path , self ::DYNAMIC_COMPONENT_NAME ) + strlen (self ::DYNAMIC_COMPONENT_NAME );
132
131
$ pathEnd = substr ($ path , $ dynamicComponentEndPosition );
132
+
133
133
return $ component . $ pathEnd ;
134
134
}
135
135
@@ -185,7 +185,7 @@ protected function addTemplateArguments(Compiler $compiler)
185
185
186
186
public function filterVariables ()
187
187
{
188
- if (!$ this ->isDynamicComponent ()) {
188
+ if (! $ this ->isDynamicComponent ()) {
189
189
return ;
190
190
}
191
191
0 commit comments