Skip to content

fix: keep strict types declaration first and convert self calls - #59

Open
lazerg wants to merge 2 commits into
pestphp:5.xfrom
lazerg:fix/strict-types-and-self-calls
Open

lazerg wants to merge 2 commits into
pestphp:5.xfrom
lazerg:fix/strict-types-and-self-calls

Conversation

@lazerg

@lazerg lazerg commented Sep 9, 2026

Copy link
Copy Markdown

Drift adds the uses() call at the very top of the file, so a test that starts with declare(strict_types=1); stops parsing after conversion. It now goes after the declare statement.

self:: and static:: calls survived the conversion too, and they fatal once the class wrapper is gone. They now become $this-> calls, which also lets the existing assertion rules pick up self::assertTrue() and the like. Calls inside a nested or anonymous class are left untouched.

Fixes pestphp/pest#1901

@lazerg

lazerg commented Oct 17, 2026

Copy link
Copy Markdown
Author

Hey @nunomaduro, please take a look when you have time

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.

[Bug]: bin/pest --drift does not take into account strict_types=1 during migration

1 participant