-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax error, unexpected T_ENDIF on line X #4
Comments
Hi, Can you show me the output of Also, do you override any built-in Blade directive by registering your own? |
Hi, sorry for not replying to you sooner but I changed my laptop and haven't been able to reproduce the error until now. The version is:
About overriding any built-in Blade directive... not that I'm aware of. Also I confirm that errors are indeed shown under the controller and not the view file. Ex:
That foreach is indeed inside the 55. @foreach($reviews as $review) which is rendered as: 53. <?php $__currentLoopData = $reviews; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $review): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> The line number (36) is indeed taken from the line returning the template: 36. return view('reviews.index', [
'reviews' => $this->reviews->paginate(),
]; |
Hi @canvural, I see that the issue is still in state "waiting for feedback". Is there any extra info needed to debug the issue? |
Sorry, super late. Here's what I've figured out: Issue 1: unexpected ')', expecting T_VARIABLEMy template is rendered as follow: public function create(): View
{
return view('someview');
} {{--someview.blade.php--}}
@include('someview._form') <?php
/** file: someview.blade.php, line: 1 */ (function () use() {
});
So from a fast check I see that the Issue 2: unexpected T_VARIABLE, expecting ';'One more issue with: <my-vue-component :enabled="@json(Module::isActive('booking'))"></my-vue-component> <?php
/** file: someview.blade.php, line: 1 */ echo json_encode(\Common\Settings\Models\Module::isActive('booking'), 15, 512)
Let me know if I'm on the right path and I'll keep debugging. |
Hi @micc83, The first issue should be fixed in the main branch. Can you try I'll investigate the second issue. Thanks. |
Hi, first of all thank you. I've been waiting to be able to run static analysis on my blade templates since a long time.
Unfortunately on my first try I get only a bunch of syntax errors such as:
or
------ -------------------------------------------------------------- Line Domain/Statistics/Http/Controllers/StatsController.php ------ -------------------------------------------------------------- 6 Syntax error, unexpected T_VARIABLE, expecting ';' on line 6 ------ --------------------------------------------------------------
What I can tell you is that, for example, SchedulePlanController doesn't even have 217 lines so, I guess, its referring to some issue in some of the blade templates rendered by the controller?
My
composer.json
is something like:My
phpstan.neon
file:I've also tried to comment larastan extension but nothing.
The text was updated successfully, but these errors were encountered: