Git Product home page Git Product logo

Comments (4)

staabm avatar staabm commented on June 1, 2024 1

if you find a repro of this problem, I could investigate. closing until its reproducible.

from phpstan-dba.

staabm avatar staabm commented on June 1, 2024

it should work, see

$query = 'SELECT MAX(adaid), MIN(adaid), COUNT(adaid), AVG(adaid) FROM ada WHERE adaid = 1';
$stmt = $pdo->query($query, PDO::FETCH_ASSOC);
assertType('PDOStatement<array{MAX(adaid): int<-2147483648, 2147483647>|null, MIN(adaid): int<-2147483648, 2147483647>|null, COUNT(adaid): int, AVG(adaid): float|null}>', $stmt);
}

how can the count be null?

from phpstan-dba.

Seldaek avatar Seldaek commented on June 1, 2024

Ah I see, probably didn't work because it's in a dynamically generated query :) https://github.com/composer/packagist/blob/bd2a83835b2eed466b598dbb1cccd7e94b281f57/src/Entity/PhpStatRepository.php#L226-L234

As for null, docs say Returns the sum of expr. If the return set has no rows, SUM() returns NULL.

from phpstan-dba.

staabm avatar staabm commented on June 1, 2024

ok. need to test whether PHP does also return NULL or turns it into a zero or maybe even emtpy string or whatever

from phpstan-dba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.