Skip to content

[1.x] Enables fully_qualified_strict_types rule - #425

Merged
nunomaduro merged 3 commits into
mainfrom
feat/fully-qualified-imports-to-qualitied-imports
Mar 10, 2026
Merged

nunomaduro merged 3 commits into
mainfrom
feat/fully-qualified-imports-to-qualitied-imports

Conversation

@nunomaduro

@nunomaduro nunomaduro commented Feb 26, 2026 •

Copy link
Copy Markdown
Member

This pull request enables the fully_qualified_strict_types rule on the Laravel Preset, effectively replacing fully qualified class names with regular imports. For example:

+ use Database\Factories\UserFactory;

class User extends Authenticatable
{
-     /** @use HasFactory<\Database\Factories\UserFactory> */
+     /** @use HasFactory<UserFactory> */
    use HasFactory, Notifiable;

Couple of things to keep in mind:

@nunomaduro
nunomaduro requested a review from taylorotwell March 9, 2026 16:49
@nunomaduro
nunomaduro marked this pull request as ready for review March 9, 2026 16:49
@taylorotwell
taylorotwell marked this pull request as draft March 9, 2026 17:24
@nunomaduro
nunomaduro marked this pull request as ready for review March 10, 2026 20:29
@nunomaduro
nunomaduro merged commit 64247d0 into main Mar 10, 2026
8 of 16 checks passed
@francoism90

Copy link
Copy Markdown

This PR seems to cause my classes to become very large (see https://github.com/laravel/pint/issues/426).

I do understand why it would be helpful, but in classes that may contain many references (e.g. an array of available clases or priority/ordered), this results in an unreadable situation if the class names aren't well named.

@DougSisk

Copy link
Copy Markdown

Really not liking this being in a minor version update.

@nunomaduro

Copy link
Copy Markdown
Member Author

Really not liking this being in a minor version update.

I understand, at the same time we want to keep improving things.. So, for people that prefer a more "stable" preset, that should just "pin" pint to a fixed version.

@browner12

Copy link
Copy Markdown

It would be nice for any changes like this to include the configuration to override the changes in the PR. I believe for this PR the configuration is:

{
    "preset": "laravel",
    "rules": {
        "fully_qualified_strict_types": false
    }
}

@nunomaduro
nunomaduro deleted the feat/fully-qualified-imports-to-qualitied-imports branch June 21, 2026 15:46
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

Successfully merging this pull request may close these issues.

4 participants