Comments (9)
I somehow know where the bug is, will try to fix asap. Thanks for reporting.
from orm-phpstan.
Well, the issue here is we try to guess the name of repository. What is FQN name of LogsRepository?
from orm-phpstan.
App\Model\System\Log (Entity)
App\Model\System\LogMapper
App\Model\System\LogRepository
from orm-phpstan.
It seems it's failing on $mapperClass = \get_parent_class($mapperClass);
in the MapperMethodReturnTypeExtension.php
as that returns false on my machine and therefore it falls into infinite loop.
$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);
$repositoryClass
is recognised correctly as App\Model\System\LogRepository
.
from orm-phpstan.
What is your definition of LogRepository? What does it extend?
from orm-phpstan.
<?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];
}
}
from orm-phpstan.
nextras-orm-phpstan-failing-demo.zip
from orm-phpstan.
Fixed c7a64f8
from orm-phpstan.
Thank you very much!!!
from orm-phpstan.
Related Issues (15)
- Persist() returns specific passed entity type HOT 1
- PHPStan 0.12 support? HOT 1
- Orm 4 support
- Broken with latest PHPStan HOT 1
- Call to undefined method PHPStan\Type\UnionType::getClassName()
- repository::persist() and others return type of 1st passed arg
- parent in Repository
- phpstan cries with Nextras ORM 4 HOT 5
- Prepare for PHPStan 1.0
- Incompatible types: Expected property
- validate entity type for repository::persist() and others
- Entity relationship property set to primary key instead of related entity generates error HOT 4
- Mapper::toEntity() & toCollection() should return typed entities
- support datetime property-write string type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orm-phpstan.