Comments (1)
Similar example in a match
statement:
function foo (?SomeEnum $bar) {
match ($bar) {
null => 'invalid',
SomeEnum::SomeCase => $bar->value,
};
}
Accessing $bar->value
gets an inspection flag. However, the null
case is evaluated first, making it impossible for $bar
to be null
in the second case.
PhpStorm 2024.2 EAP
Build #PS-242.10180.24, built on May 14, 2024
Runtime version: 21.0.3+13-b446.1 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 12
Registry:
debugger.new.tool.window.layout=true
run.processes.with.pty=TRUE
ide.experimental.ui=true
from phpinspectionsea.
Related Issues (20)
- java.lang.Throwable: Control-flow exceptions HOT 1
- Roadmap for Q1 and Q2 of 2024 HOT 3
- AmbiguousMethodsCallsInArrayMappingInspection used in both Extended and Ultimate plugin
- [EA] New value type (bool) is not matching the resolved parameter type HOT 5
- Inspections slow to refresh HOT 1
- java.lang.NullPointerException
- False positive: null-coalesce suggested: "$test::class ?? null"
- [FP] `Senseless proxy function` for overwritten constructor with promoted property
- False-positive "not matching the resolved parameter type" with $_POST HOT 2
- Potentially false-positive `Operations priority`
- Merge with parent if removes comments HOT 1
- Potential false-positive `[] operator not supported for strings`
- mkdir replacement looses recursive flag
- Incorrect Inspection for unused
- False positive `may not support offset operations` for mb_str_split
- Enums are treated as empty classes
- Class overrides a field of a parent class
- False positive non-related statements in try-block
- Senseless proxy function False Positive for method with PHPStan PHPDoc comment
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 phpinspectionsea.