Skip to content

Conversation

staabm
Copy link
Owner

@staabm staabm commented Mar 3, 2022

refs #282 (comment)

this should also make phpstan-dba analysis possible across method boundaries.
atm all parts required for the inference need to be accessible from a single method.

I guess cases like

    public function querySelected(PDO $pdo): PDOStatement
    {
        return $pdo->query('SELECT email, adaid, gesperrt, freigabe1u1 FROM ada');
    }

    public function fetch(PDO $pdo):array {
       $stmt = $this->querySelected($pdo);
       return $stmt->fetch();
    }

    public function workWithData(PDO $pdo) {
       $data = $this->fetch($pdo);
       assertType('string', $data['email']);
    }

should work after we use the ObjectType properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants