Skip to content

Incorrect {@inheritdoc} precedence #306

@jiripudil

Description

@jiripudil

I've run into this problem with Kdyby/Doctrine:

namespace Doctrine\ORM;
class EntityManager
{
	/**
	 * @return void
	 */
	public function persist($entity) {}
}
namespace Kdyby\Doctrine;
class EntityManager extends \Doctrine\ORM\EntityManager
{
	/**
	 * {@inheritdoc}
	 * @return EntityManager
	 */
	public function persist($entity) {}
}

I'd expect the return type to be Kdyby\Doctrine\EntityManager, however,

/** @var Kdyby\Doctrine\EntityManager $em */
$em->persist($entity)->flush();

reports errors:

Cannot call method flush() on void.                                      
Result of method Kdyby\Doctrine\EntityManager::persist() (void) is used.

(phpstan 0.7.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions