Comments (6)
I am not sure if this should be handled as that part of ArrayDimFetch definition, which by lookup of the whole class, should be used, and probably very rare of not follow the definition.
from rector.
I am not sure I got your point.
my thinking was, that getTokens()
returns a native array and we can't know its key or value types. therefore I think the $activeTokens[$this->tokenid]
dim fetch returns a mixed
(in native type world) and therefore we have 2 property assignments in __construct
. one with string
and one with mixed
which should lead to skipping instead of adding a type.
from rector.
The getTokens(): array
define @return array<string, string>
which it return typed array, so, array data should be string
, yes, that can be wrong, but likely rare imo.
If that not always an array of string, the $_SESSION[self::$sessionName]
can be not an array as well, so the definition should follow.
from rector.
I think the lesson learned from a year ago was, that phpdoc are oftentimes wrong and we shouldn't trust them?
from rector.
I see, but still, an array<>
and array{}
something that obvious, define by hand, and less copy paste error i guess, as that check by another assign and definition.
If the definition is overlapped between property and assignment, phpstan already catch early.
Yes, that's not perfect, but imo, that seems a way to make it typed.
from rector.
I am going to close it, the type is obvious looking by the whole class, with if else native data assigned.
PHP Array doesn't have native structured type, and writing correct array{}
definition is another effort to be correct iterate definition in PHPStan, little wrong and it already catched by PHPStan, that after that, should be followed.
from rector.
Related Issues (20)
- Moving from PHP 5.6 to 8.1 HOT 5
- Is there a way to avoid adding type declarations for anonymous functions / callbacks? HOT 3
- Could not process a file due to System error: Cannot rename HOT 7
- AnnotationToAttributeRector makes incorrect boolean arg HOT 1
- Rector analysis fails when using phar-distributed phpunit HOT 26
- System error: "leaveNode() returned invalid value of type integer" HOT 3
- Incorrect behavior of ClassPropertyAssignToConstructorPromotionRector HOT 2
- Incorrect behavior of ClassPropertyAssignToConstructorPromotionRector
- Design flaw in FinalizeClassesWithoutChildrenRector HOT 12
- Error processing upgrade from PHP 5.3 to latest HOT 5
- `and` keyword is misinterpreted HOT 2
- Rules sets for upgading only nessecary things for uptating PHP version HOT 2
- Can't configure Rector with Symfony, using latest RectorConfigBuilder HOT 9
- mysql() functions HOT 1
- Incorrect behavior of MakeEntityDateTimePropertyDateTimeInterfaceRector HOT 3
- Incorrect behavior of NullToStrictStringFuncCallArgRector HOT 1
- ConvertRenderTemplateShortNotationToBundleSyntaxRector doesn't work with variables HOT 2
- Incorrect behavior of ReturnUnionTypeRector
- Import names combines import aliases HOT 1
- Unable to run composer install on rector-src fork HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rector.