Comments (10)
having a mixed only for a single column-type would mean you are running into this case:
are you sure you are using the same db schema locally and in CI?
maybe its a difference in mysql versions or maria db vs. mysql?
alternatively: maybe your schema is using a column type, which is not yet properly mapped to a phpstan type in
phpstan-dba/src/QueryReflection/MysqliQueryReflector.php
Lines 182 to 301 in e2939f2
from phpstan-dba.
The package table has a simple int(11) primary id, nothing weird, and it definitely hasn't changed in 10 years so I believe my local schema matches CI :)
I'm on mysql8.0.13 and GH is on 8.0.26 but I doubt that'd make a difference here.. I can try to upgrade to be sure, wouldn't hurt anyway ;)
from phpstan-dba.
If time allows I can debug the CI job and the used phpstan-dba version within the CI pipeline.
from phpstan-dba.
On 8.0.28 locally now, still can't repro :/
from phpstan-dba.
Very confused, just tried again to run phpstan and suddenly it changed to the same output as CI?!
I even tried clearing PHPStan & phpstan-dba caches earlier, it didn't help.. proper WTF here.. but at least it works now so I guess closing 🤷♂️
from phpstan-dba.
hm ok, so you are now able to debug locally why its returning mixed
?
running phpstan with --debug
disables all caches.. thats the first thing I try when caching might be a problem.
from phpstan-dba.
I have a new theory, why you get a array<int, mixed>
,..
doctrine defines the method fetchFirstColumn
on Connection
to return list<mixed>
:
https://github.com/doctrine/dbal/blob/0dc504e80b400870d4d1d0392394164b4dd39019/src/Connection.php#L888-L902
in your example phpstan-dba is taking one of the return $defaultReturn
branches and therefore defines the return-type to whatever doctrine-dbal itself defines at the phpdoc level
I am not yet sure for the exact reason.
from phpstan-dba.
just installed packagist locally and did some debugging.
the reason for this query not beeing analyzable is the following mysql error:
phpstan-dba simulates a value which does not fit to the mysql native type and therefore we produce a sql error
from phpstan-dba.
I think we can consider this issue fixed.
the acual problem was, that we skipped everything which had no parameters.
from phpstan-dba.
Thanks!
from phpstan-dba.
Related Issues (20)
- Connection::insert data inference does not use indicated Types HOT 4
- mysqli: error on invalid escaping HOT 5
- Query AST analysis? HOT 2
- Get AST data from `$queryReflection->getResultType` HOT 15
- AST doubts regarding null/not-null HOT 4
- AST: inconsistent behavior with functions and aliases HOT 4
- Analyzing multiple connections HOT 6
- Right vs left join HOT 2
- AST: generic operator support HOT 2
- pgsql support for AST HOT 2
- give up sql based narrowing in case sqlftw cannot parse the query
- pgsql support for uuid type
- Support for (PDO->prepare())->execute() HOT 6
- generic type mysqli_result error with phpstan v1.10.36 and v1.10.37 HOT 2
- Support for custom API's for type inference HOT 1
- Check driver differences
- dibi support DATE_FORMAT
- Psalm support
- Using with doctrine/dbal HOT 8
- CI: Separate Testing of Doctrine 3.x and 4.x
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-dba.