Repository navigation
Conversation
| $result = $conn->query('SELECT email, adaid, gesperrt, freigabe1u1 FROM ada'); | ||
| assertType('Doctrine\DBAL\Result<array{email: string, 0: string, adaid: int<0, 4294967295>, 1: int<0, 4294967295>, gesperrt: int<-128, 127>, 2: int<-128, 127>, freigabe1u1: int<-128, 127>, 3: int<-128, 127>}>', $result); | ||
|
|
||
| $numericFetch = $result->fetchNumeric(); | ||
| assertType('array{string, int<0, 4294967295>, int<-128, 127>, int<-128, 127>}', $numericFetch); | ||
|
|
||
| $numericFetch = $result->fetchAssociative(); | ||
| assertType('array{email: string, adaid: int<0, 4294967295>, gesperrt: int<-128, 127>, freigabe1u1: int<-128, 127>}', $numericFetch); |
There was a problem hiding this comment.
@Seldaek could you verify this api and type expectations are correct?
| assertType('array<int, array{string, int<0, 4294967295>, int<-128, 127>, int<-128, 127>}>', $fetch); | ||
|
|
||
| $fetch = $result->fetchAllAssociative(); | ||
| assertType('array<int, array{email: string, adaid: int<0, 4294967295>, gesperrt: int<-128, 127>, freigabe1u1: int<-128, 127>}>', $fetch); |
There was a problem hiding this comment.
fetchAll* should perhaps return list<array{}> ? I imagine this is true for all drivers but who knows.
There was a problem hiding this comment.
phpstan does not yet support the list type natively. atm you can do this in phpdoc, but internally its still a array.
I thought about using a positive-int key.. not sure this holds?
There was a problem hiding this comment.
Ah interesting :) Yes I'd think positive-int is true, if list<> is true.. I'm sure it's 99% true and there's someone with a weird implementation somewhere that breaks it but probably this won't matter?
There was a problem hiding this comment.
yeah, I think we should go as strict as possible.
There was a problem hiding this comment.
be careful. positive-int means >0, which is wrong for lists
There was a problem hiding this comment.
Thx. We used int<0, max> in the end
|
@Seldaek I have no application to actually test this dbal extension. could you give it a go for a small smoketest? if it works for you, we can ship the next release later today with initial doctrine support :-) |
|
Yeah happy to check later but probably easier if you merge it all first. |
refs #94
adds support for
Connection->query()Result->fetchNumeric()Result->fetchAssociative()Result->fetchAllNumeric()Result->fetchAllAssociative()Result->columnCount()