Comments (12)
from phpstan-strict-rules.
in phpstan.org: https://phpstan.org/r/5d6e8557-1ca9-4293-af0d-c56f617b77a9
I get only one error: "Result of && is always true."
from phpstan-strict-rules.
I challenge you to produce "not ok": https://3v4l.org/U8SJ7
from phpstan-strict-rules.
here - https://3v4l.org/ecfEs
from phpstan-strict-rules.
PHPStan also tells you that: https://phpstan.org/r/92b6e91f-7212-4eb2-8ed2-ec5ec8a3c8c3 So I don't see a bug here.
from phpstan-strict-rules.
for exp.: we get the separator from any function and the separator have empty string. We must verify "\is_array($texts) && \is_array($texts2)"
`
$separator = '';
$array = 'this is, a test';
$array2 = 'this is, a test2';
$texts = explode($separator, $array);
$texts2 = explode($separator, $array2);
if (\is_array($texts) && \is_array($texts2)){
echo 'ok';
} else {
echo 'not ok';
}`
`
public function test(string $separator)
$array = 'this is, a test';
$array2 = 'this is, a test2';
$texts = explode($separator, $array);
$texts2 = explode($separator, $array2);
if (\is_array($texts) && \is_array($texts2)){
echo 'ok';
} else {
echo 'not ok';
}
}
`
from phpstan-strict-rules.
I can't reproduce it: https://phpstan.org/r/3aa1b88b-1278-461b-b66b-48267f5b1dc4
from phpstan-strict-rules.
https://phpstan.org/r/39771324-41ee-4ef1-aa9f-65c900b5f55c
from phpstan-strict-rules.
We're not making any progress here. Unless you produce an example that shows "not ok" on 3v4l.org and "No errors" on phpstan.org, there's no bug.
from phpstan-strict-rules.
https://3v4l.org/ecfEs - "not ok"
https://phpstan.org/r/39771324-41ee-4ef1-aa9f-65c900b5f55c
+------------------------------------------------------------------------------+
| Line | test.php |
+------------------------------------------------------------------------------+
| 9 | Result of && is always false. |
| 9 | Call to function is_array() with false will always evaluate to false. |
| 9 | Call to function is_array() with false will always evaluate to false. |
+------------------------------------------------------------------------------+
from phpstan-strict-rules.
Yes, PHPStan tells you actually what's going on. It can differentiate between empty (false
), non-empty (array<string>
) and unknown (array<string>|false
) delimiter.
from phpstan-strict-rules.
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-strict-rules.
Related Issues (20)
- Disable all rules does not work HOT 3
- Force `@return` to match return type HOT 2
- [1.5.0] Error after added `$bleedingEdge` constructor parameter HOT 5
- display the name of the rule in the log HOT 2
- Disallow offset access on string
- Missing `#[Override]` HOT 2
- Add `uselessTrim` rule for useless `trim()`
- Relaxed booleansInConditions to allow 0, 1? HOT 5
- Add support to requireParentConstructorCall for indirect calls
- `class-string` should not be settable using string literal HOT 2
- Disallow casting potential nulls to int/string/array HOT 1
- Disallow foreach by-reference
- checkDynamicProperties, setting variable in while loop condition gets reported as might not be defined HOT 2
- Using named arguments with in_array causes a function.strict error HOT 2
- disallowedLooseComparison - allow only DateTime/DateTimeImmutable HOT 4
- Check if override method does not rename parameters
- Overriding a vendor class member with imperfect type declaration: No way to not get errors HOT 3
- Upgrade to PHP-Parser 5 HOT 5
- False positive "Variable might not be defined" after `for` loop HOT 2
- Variable property access on SimpleXMLElement
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-strict-rules.