-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Drop support for php < 8.1 #80
Conversation
61dc00b
to
bf6b424
Compare
* @return bool | ||
*/ | ||
public function isA($value, $token) | ||
public function isA(mixed $value, int|string $token) | ||
{ | ||
return $this->getType($value) === $token; |
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.
This is weird… isA()
can be called with mixed
, and then calls getType()
which is typed as string
. Which type declaration should get fixed? In the tests, there are calls to isA()
with ints or floats:
lexer/tests/Doctrine/Common/Lexer/AbstractLexerTest.php
Lines 277 to 278 in 9b3ee62
$this->assertTrue($this->concreteLexer->isA(11, 'int')); | |
$this->assertTrue($this->concreteLexer->isA(1.1, 'int')); |
Weirdly, static analysis does not have anything to say about this.
Note that this method is not used at all in the ORM or the ODM
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.
Do we even expect something different than a string here? My preference would be to change the declaration of isA()
.
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.
static analysis has nothing to say because phpstan runs at level 7, not at max level (i.e. 9). Until level 8, mixed
behaves like Typescript's any
: everything is valid with it. It is only at level 9 that it is treated like Typescript's unknown
bf6b424
to
530c0b5
Compare
I'm waiting on the outcome of the discussion on #79 to decide what to do with this. If we still support PHP 7.1 on 2.0, it might be acceptable to bump to 2.0 on |
Blocked by #96 |
530c0b5
to
f195031
Compare
f195031
to
c36b509
Compare
c36b509
to
c4f371c
Compare
No description provided.