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

Check datetime instantiation #380

Merged
merged 2 commits into from Nov 24, 2020

Conversation

b1rdex
Copy link
Contributor

@b1rdex b1rdex commented Nov 23, 2020

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

And finally, please fix the build (Failures on PHP 8 are fine - they're on master already.)

conf/config.level0.neon Outdated Show resolved Hide resolved
src/Rules/DateTimeInstantiationRule.php Outdated Show resolved Hide resolved
src/Rules/DateTimeInstantiationRule.php Outdated Show resolved Hide resolved
tests/PHPStan/Rules/DateTimeConstructorRuleTest.php Outdated Show resolved Hide resolved
Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

This actually needs fixing:

Cannot access offset 'warnings' on array('warning_count' => int,     
         'warnings' => array<int, string>, 'error_count' => int, 'errors' =>  
         array<int, string>)|false.

src/Rules/DateTimeInstantiationRule.php Outdated Show resolved Hide resolved
@b1rdex
Copy link
Contributor Author

b1rdex commented Nov 23, 2020 via email

@ondrejmirtes
Copy link
Member

@b1rdex That's easy: https://3v4l.org/HBq0q

@ondrejmirtes
Copy link
Member

It tells me that you haven't tested a case where the rule should not report anything :)

@b1rdex
Copy link
Contributor Author

b1rdex commented Nov 23, 2020 via email

@ondrejmirtes ondrejmirtes merged commit aa9a1ff into phpstan:master Nov 24, 2020
@ondrejmirtes
Copy link
Member

Thank you!

@b1rdex b1rdex deleted the datetime-instantiation branch November 24, 2020 09:50
@ondrejmirtes
Copy link
Member

FYI I removed reporting warnings because it's not that useful: https://3v4l.org/TGsaG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants