Skip to content
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

php artisan blade:validate leaves bunch of empty temp_* directories when PHPStan is enabled #29

Closed
ernix opened this issue Mar 1, 2024 · 4 comments

Comments

@ernix
Copy link
Contributor

ernix commented Mar 1, 2024

It's hard reproduce the issue, but if Larastan is installed and PHPStan options are enabled, empty temporary directories are not being cleaned up after the validate command.

rmdir temp_* is a workaround for the issue but it obviously is not the intended behavior as validate command was executed successfully (returns 0). Would you mind taking a look if you have the time?

When I turn off PHPStan integration, temporary directories will be removed as I expected.

Thanks

versions

nunomaduro/larastan: v2.9.1
stillat/blade-parser: v1.7.0

phpstan.neon

includes:
    - ./vendor/nunomaduro/larastan/extension.neon

parameters:
    paths:
        - app

    ignoreErrors:
        - '#Call to an undefined static method Illuminate\\Support\\Facades\\DB::getSequence\(\).#'
        - '#Call to an undefined method Monolog\\Handler\\HandlerInterface::setFormatter\(\).#'
        - '#Call to an undefined method Monolog\\Handler\\HandlerInterface::pushProcessor\(\).#'
        - '#Do-while loop condition is always false.#'

    level: 5
@JohnathonKoster
Copy link
Collaborator

Do you have other dependencies, like Livewire by chance? I'll try and sort this out this upcoming weekend

@ernix
Copy link
Contributor Author

ernix commented Mar 1, 2024

@JohnathonKoster No, I don't.

Reproduce process:

$ composer --version
Composer version 2.7.1 2024-02-09 15:26:28
$ cat /etc/redhat-release
AlmaLinux release 8.7 (Stone Smilodon)
$ composer create-project laravel/laravel example-app
$ cd example-app
$ composer require larastan/larastan:^2.0 --dev
$ composer require stillat/blade-parser --dev
$ php artisan vendor:publish --tag=blade
$ php artisan blade:validate -vvv
Running 20 validators against 1 files; PHPStan document validation enabled.
/resources/views/welcome.blade.php
[BLADE_V011] Inconsistent casing for [@endauth]; expecting [@endAuth] on line 30
Analyzed 1 files in 00:00:01 (Blade Parser: 00:00:00 PHPStan: 00:00:01)
$ ls -ald temp_*
drwxr-xr-x 2 kojima staff 6 3月 1 11:56 temp_f1180b69d9d773c79bc55e93106cab64434c436d.php
$ test -z "$(ls -A temp_f1180b69d9d773c79bc55e93106cab64434c436d.php)"; echo $?
0

@JohnathonKoster
Copy link
Collaborator

Thanks for the additional info and steps!

@JohnathonKoster
Copy link
Collaborator

Thanks for the PR. Its very much appreciated! I've released that as 1.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants