GithubHelp home page GithubHelp logo

Comments (9)

hrach avatar hrach commented on September 1, 2024 3

I somehow know where the bug is, will try to fix asap. Thanks for reporting.

from orm-phpstan.

hrach avatar hrach commented on September 1, 2024

Well, the issue here is we try to guess the name of repository. What is FQN name of LogsRepository?

from orm-phpstan.

stpnkcrk avatar stpnkcrk commented on September 1, 2024

App\Model\System\Log (Entity)
App\Model\System\LogMapper
App\Model\System\LogRepository

from orm-phpstan.

stpnkcrk avatar stpnkcrk commented on September 1, 2024

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.

hrach avatar hrach commented on September 1, 2024

What is your definition of LogRepository? What does it extend?

from orm-phpstan.

stpnkcrk avatar stpnkcrk commented on September 1, 2024
<?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.

stpnkcrk avatar stpnkcrk commented on September 1, 2024

nextras-orm-phpstan-failing-demo.zip

from orm-phpstan.

hrach avatar hrach commented on September 1, 2024

Fixed c7a64f8

from orm-phpstan.

stpnkcrk avatar stpnkcrk commented on September 1, 2024

Thank you very much!!!

from orm-phpstan.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.