Open
Description
I thought I'd just add an issue so that this doesn't get lost, however I'm currently looking into it a bit. 👍🏻
See owenvoke#3 for a fixture that demonstrates this issue.
When using the @include()
directive with a file that contains use statements, in standard Blade it compiles to separate files, whereas (AFAICT) this package compiles to a single file which is checked (correct me if I'm wrong). But this causes the use statements to fail as they are in the global scope. Resulting in a PHP syntax error.
The error that will be output is:
PhpParser\Error: Syntax error, unexpected T_USE on line 5
Looks like it's because the use
statement is embedded inside a function
block when it's compiled. 🤔 e.g.
<?php
(function () {
use Illuminate\Support\Facades\URL;
URL::current();
});