phpstan-doctrine
phpstan-doctrine copied to clipboard
Doctrine extensions for PHPStan
In the last months I worked in a project which uses `MariaDB`. While on MySQL utf8mb4 I'm not able to create `Indexes` longer then `191` chars, MariaDB in its default...
Related to https://github.com/phpstan/phpstan-doctrine/pull/506#issuecomment-1944268880 @janedbal, I try to introduce tests on different platform. Does this solution would work for you ? Edit: Are you also ok with this solution @ondrejmirtes ?...
Friendly ping on this @craigfrancis, I'm never sure when dealing with `literal-string`. In the same way that we enforce passing literal string to QueryBuilder methods in https://github.com/phpstan/phpstan-doctrine/blob/1.4.x/stubs/bleedingEdge/ORM/QueryBuilder.stub I wonder if...
Related to https://github.com/phpstan/phpstan-doctrine/issues/545 If you're okay adding something like this here, I can do the same rule for executeStatement @ondrejmirtes.
Currently, inferring numeric types (mainly results of `AVG`, `SUM` etc) is imperfect as [it is currently implemented to serve all configurations](https://github.com/phpstan/phpstan-doctrine/blob/1.4.x/src/Type/Doctrine/Query/QueryResultTypeWalker.php#L841-L842) resulting in union types like `int|numeric-string`. This is painful...
I created this rule for our own code base because we forgot to properly hint to arrays when refactoring code to use doctrine. I figured it could be useful to...
When using two database, one with READ/WRITE rights and one replica with READ writes, Doctrine use `executeQuery/executeStatement` to know which database to use. In this situation using `executeQuery` for UPDATE/DELETE/etc...
Hi All, I encountered an issue where PHPStan threw an incorrect error regarding method return type declaration. Here's the scenario: **Problem**: I have a method getData() in my codebase which...
New rule: forbid replacing a persistent Doctrine collection field instead of mutating the collection
When a field is a toMany relation, Doctrine relies on a special Collection implementation to track changes. A common mistake is a write a setter that replaces the collection entirely...
Hello, with ORM, this code leads to invalid SQL queries when `$field` is null: ``` ->andWhere('t.field = :field') ->setParameter('field', $field) ``` see https://github.com/doctrine/orm/issues/7289 do you think it could be nice...