cycle / database

Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
MIT License
54 stars 23 forks source link

🐛 Psalm errors in 2.6.0 #141

Closed gam6itko closed 11 months ago

gam6itko commented 11 months ago

No duplicates 🥲.

Database

MySQL

What happened?

After updating cycle/database to 2.6.0 psalm start to show errors.

ERROR: InternalMethod - src/Service/ClassA.php:131:15 - The method Cycle\Database\Query\DeleteQuery::run is internal to Cycle, Cycle, and Cycle but called from ClassA::doDelete (see https://psalm.dev/175)
            ->run();

ERROR: InternalMethod - ClassB.php:40:15 - The method Cycle\Database\Query\SelectQuery::from is internal to Cycle, Cycle, and Cycle but called from ClassB::getFormDbByCode (see https://psalm.dev/175)
            ->from('city')
// a
 $this->db
            ->delete('table_a')
            ->where('id', 'IN', new Parameter($toDeleteIdList))
            ->run();

// b

        $list = $this->db
            ->select(['id'])
            ->from('city')
            ->where('code', $code)
            ->fetchAll();

I think the problem is here: https://github.com/cycle/database/commit/54dab6f25735ed476ac8a740b48e4cc362e49c9b

Version

database 2.6.0
PHP 8.2