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

Update PHPStan to 1.12 #609

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Update PHPStan to 1.12 #609

merged 2 commits into from
Sep 11, 2024

Conversation

SenseException
Copy link
Member

No description provided.

Comment on lines 82 to 84
preg_match('/<p>{{ DOCS_SOURCE_PATH : (.*) }}<\/p>/', $contents, $match);

assert(count($match) === 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asserting that the regex did actually match should also narrow the match array enough.

Suggested change
preg_match('/<p>{{ DOCS_SOURCE_PATH : (.*) }}<\/p>/', $contents, $match);
assert(count($match) === 2);
$result = preg_match('/<p>{{ DOCS_SOURCE_PATH : (.*) }}<\/p>/', $contents, $match);
assert($result === 1);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does. I didn't expect that phpstan can work with the return value to handle the matches.

@derrabus
Copy link
Member

It's 1.12, not 2.12. 🤓

@SenseException SenseException changed the title Update PHPStan to 2.12 Update PHPStan to 1.12 Sep 10, 2024
@SenseException
Copy link
Member Author

It was a PR from the future, but I downgraded the version to the one that is known to the current time. 😇

@SenseException SenseException merged commit 87ccd96 into master Sep 11, 2024
6 checks passed
@SenseException SenseException deleted the phpstan212 branch September 11, 2024 18:15
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