Skip to content

Blade formatting fails with PSR autoloading #465

Description

@mdavis1982

Pint Version

1.30.0

PHP Version

8.5.8

Description

When attempting to use pint --blade, I am getting the following error message:

PhpCsFixer\Preg::match(): Argument #2 ($subject) must be of type string, false given, called in phar:///Users/matt/Developer/Sites/my-app

It seems that I can get this to work properly if I remove the following rule from my pint.json:

"psr_autoloading": {
    "dir": "app"
},

With that rule removed, I don't get the error anymore and formatting seems to be working as expected.

Steps To Reproduce

  1. Create a new Laravel app
  2. Add a pint.json with the following:
{
    "preset": "laravel",
    "rules": {
        "psr_autoloading": {
            "dir": "app"
        }
    }
}
  1. Run pint --blade and observe the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions