Comments (4)
Hi, this is definitely happening because you're using bleedingEdge, this is a preview how 1.0 is going to behave.
There's an article about this: https://phpstan.org/blog/remembering-and-forgetting-returned-values
Your solution is to store event into a variable right after the assert.
from phpstan-webmozart-assert.
This is what's probably going on in your original code: https://phpstan.org/r/22970d69-43e2-4607-9d82-cbaf6e5c884c
from phpstan-webmozart-assert.
Got it, makes sense! Thanks.
from phpstan-webmozart-assert.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from phpstan-webmozart-assert.
Related Issues (20)
- Validating nested arrays ends in mixed HOT 5
- Assert::range() with arguments float, 0 and 1 will always evaluate to true HOT 1
- Assert::greaterThan(), Assert::lessThan() with arguments float and 0 will always evaluate to true HOT 1
- Support for assertions resulting in non-empty string HOT 2
- Call to static method Webmozart\Assert\Assert::allCount() with array and 2 will always evaluate to true. HOT 6
- False positive: Call to inArray() with different object instances will always evaluate to true HOT 13
- Issue with `implementsInterface` HOT 9
- `Assert::notNull()` should warn when argument is never null HOT 3
- allIsInstanceOf / allNotNull does not tell phpstan that its evaluated as expected HOT 3
- Assert::true should behave the same as native assert() HOT 2
- Call for help: Modernize AssertTypeSpecifyingExtensionTest HOT 1
- Internal type conversion from array to iterable. HOT 3
- Assert::minLength($s, 1) should assert type to non-empty-string HOT 2
- False positive: inArray with string and array('value1', 'value2') will always evaluate to true. HOT 4
- Assert::length() should result in non-empty-string HOT 2
- Assert::isNonEmptyList should result in non-empty-list HOT 4
- False positive: Call to static method Webmozart\Assert\Assert::count() with arguments non-empty-array<int, string>, 2 and 'error' will always evaluate to true HOT 6
- False positive on `Assert::upper()` always evaluates as true HOT 8
- Dependency Dashboard
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 phpstan-webmozart-assert.