File tree 1 file changed +21
-10
lines changed
src/Illuminate/View/Compilers
1 file changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -186,17 +186,9 @@ public function setPath($path)
186
186
*/
187
187
public function compileString ($ value )
188
188
{
189
- if (strpos ($ value , '@verbatim ' ) !== false ) {
190
- $ value = $ this ->storeVerbatimBlocks ($ value );
191
- }
192
-
193
- $ this ->footer = [];
189
+ [$ this ->footer , $ result ] = [[], '' ];
194
190
195
- if (strpos ($ value , '@php ' ) !== false ) {
196
- $ value = $ this ->storePhpBlocks ($ value );
197
- }
198
-
199
- $ result = '' ;
191
+ $ value = $ this ->storeUncompiledBlocks ($ value );
200
192
201
193
// Here we will loop through all of the tokens returned by the Zend lexer and
202
194
// parse each one into the corresponding valid PHP. We will then have this
@@ -219,6 +211,25 @@ public function compileString($value)
219
211
return $ result ;
220
212
}
221
213
214
+ /**
215
+ * Store the blocks that do not receive compilation.
216
+ *
217
+ * @param string $value
218
+ * @return string
219
+ */
220
+ protected function storeUncompiledBlocks ($ value )
221
+ {
222
+ if (strpos ($ value , '@verbatim ' ) !== false ) {
223
+ $ value = $ this ->storeVerbatimBlocks ($ value );
224
+ }
225
+
226
+ if (strpos ($ value , '@php ' ) !== false ) {
227
+ $ value = $ this ->storePhpBlocks ($ value );
228
+ }
229
+
230
+ return $ value ;
231
+ }
232
+
222
233
/**
223
234
* Store the verbatim blocks and replace them with a temporary placeholder.
224
235
*
You can’t perform that action at this time.
0 commit comments