-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
A whole slew of changes for 3.0.x! See the summary. #1079
A whole slew of changes for 3.0.x! See the summary. #1079
Conversation
1f1d65a
to
eee6eb6
Compare
is it expected to change the indentation of composer.json ? |
I ran composer.json through the npm package |
eee6eb6
to
4f6bea5
Compare
self::assertRegExp('/^Foo\\\\Version[0-9]{14}$/', $fqcn); | ||
|
||
if (method_exists($this, 'assertMatchesRegularExpression')) { | ||
$this->assertMatchesRegularExpression('/^Foo\\\\Version[0-9]{14}$/', $fqcn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we should use the static implementation, so self
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't play well with phpstan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More info: method_exists
cannot take self
as the first parameter. So if you use $this
for method_exists
then use self
for assertMatchesRegularExpression
phpstan
has a problem with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using the class name (can't use $this::class
for now since it's PHP 8 but TestCase::class
should do the trick)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. You see, phpstan is clearing (for lack of a better term) the use of $this after the method_exists function and seeing that it won't be called passes.
if (method_exists(TestCase::class, 'assertMatchesRegularExpression')) {
self::assertMatchesRegularExpression('/^Foo\\\\Version[0-9]{14}$/', $fqcn);
Results in
------ ----------------------------------------------------------------------------------------------------------------------------------
Line tests/Doctrine/Migrations/Tests/Generator/ClassNameGeneratorTest.php
------ ----------------------------------------------------------------------------------------------------------------------------------
20 Call to an undefined static method Doctrine\Migrations\Tests\Generator\ClassNameGeneratorTest::assertMatchesRegularExpression().
------ ----------------------------------------------------------------------------------------------------------------------------------
tests/Doctrine/Migrations/Tests/Tools/Console/Command/StatusCommandTest.php
Outdated
Show resolved
Hide resolved
This repo needs to be set to a minimum PHP version of 7.3 in a future version so we can remove the check for the DBAL version which is deprecated and remove the logic for using using a regex assertion. |
26b6502
to
2ac5b0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! thanks a lot @TomHAnderson
Summary
Please note the branch name is now out of sync with this PR.