Comments (4)
I'm not sure I understand the fix you propose?
from scrutinizer.
I don't looked at the code for now so I can't give a real proposal ATM (I'll investigate as you seem to confirm the bug).
But, the problem is there is a check preventing the error that the patch is trying to prevent, and this check is not considered.
Do you see a way to look for a return (or any breaking statement) that would prevent the method to be called with an invalid argument and so make this patch not helpful?
The @param false|array
has nothing to do with the real issue, I removed it from the description.
As I never worked on this code until here, it would be nice if you have a suggestion.
from scrutinizer.
There is a difference between
/** @param boolean|string $x */
function($x) {
if ( ! $x) {
return;
}
// $x is still boolean|string here, since it could be true
}
and
/** @param false|string $x */
function($x) {
if ( ! $x) {
return;
}
// $x is just string here, since false is excluded by if
}
If I understand correctly, you have the first case in your code. I don't see how we can make the analysis smarter in that case though. If I'm missing something, please let me know.
from scrutinizer.
Yes, you got it.
And sure, there is nothing to do. I think that I would have liked to have a patch for the inverse side, saying that if @x
can be only false because it cannot be true
and is not checked for true
in the method, the doc should be @param false|string
and not bool|string
.
Overkill (or impossible), I close this.
Thank's for your time.
from scrutinizer.
Related Issues (20)
- phpcs custom_coding_standard from dependency in vendor/ HOT 4
- What is the API rate limit? HOT 2
- Granular permissions HOT 7
- Feature request - Display project under inspection
- Container can't download PhantomJS HOT 2
- MongoDB v3 support
- Deprecation notices without condition HOT 1
- Similar return types not recognized as such
- Do not ignore PhpDoc on higher levels HOT 1
- Send external code coverage for JS project HOT 1
- PHP7+ support HOT 2
- PHPCS and other tools don't seem to run (correctly) HOT 1
- Scrutinizer doesn't understand self HOT 1
- How can I upload external code coverage to scrutinizer-ci HOT 1
- Disable tests HOT 2
- Create GitHub issue based on Scrutinizer issue?
- PHP add coding style to declare without spaces in the assignment
- Unknown Database Scrutinizer issue
- Update version of composer HOT 1
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 scrutinizer.