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

Strict types expectation allows for comments above declaration #1279

Merged

Conversation

midnite81
Copy link
Contributor

What:

  • [X ] Bug Fix
  • New Feature

Description:

This fixes an issue where you're using toUseStrictTypes, but have comments above the declaration, for example ide suppression comments. I have updated the regex use to allow for comments. I've added three tests to ensure that comments do not cause the test to fail when the declare(strict_types=1); is present.

(From my commit message)
Introduced new test cases to ensure strict type declaration handling. Files with and without strict types are tested, including scenarios with comments preceding the declaration. Updated the regex in Expectation.php to accommodate comments and whitespaces before the declare(strict_types=1) statement.

Introduced new test cases to ensure strict type declaration handling. Files with and without strict types are tested, including scenarios with comments preceding the declaration. Updated the regex in `Expectation.php` to accommodate comments and whitespaces before the `declare(strict_types=1)` statement.
@nunomaduro nunomaduro merged commit e38a271 into pestphp:3.x Sep 29, 2024
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.

2 participants