-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapper::toCollection() breaks PHPStan #17
Comments
Well, the issue here is we try to guess the name of repository. What is FQN name of LogsRepository? |
App\Model\System\Log (Entity) |
It seems it's failing on $mapperClass = $mapper->getClassName();
do {
/** @phpstan-var class-string<\Nextras\Orm\Repository\Repository> $repositoryClass */
$repositoryClass = \str_replace('Mapper', 'Repository', $mapperClass);
$mapperClass = \get_parent_class($mapperClass);
assert(is_string($mapperClass));
} while (!\class_exists($repositoryClass) && $mapperClass !== DbalMapper::class);
|
What is your definition of LogRepository? What does it extend? |
<?php declare(strict_types=1);
namespace App\Model\System;
use Nextras\Orm\Collection\ICollection;
use Nextras\Orm\Repository\Repository;
/**
* @method ICollection|Log[] findAllWithTranslatedIps()
*/
final class LogRepository extends Repository
{
public static function getEntityClassNames(): array
{
return [Log::class];
}
} |
I somehow know where the bug is, will try to fix asap. Thanks for reporting. |
Fixed c7a64f8 |
Thank you very much!!! |
PHPStan 0.12.40
Nextras\Orm 4.0-RC1
Nextras\Orm-PHPStan dev-master
This makes PHPStan with active nextras/orm-phpstan extension to freeze when analysing the file.
The issue persists even with just
$this->builder()
suggesting error isn't in the custom select part.The text was updated successfully, but these errors were encountered: