Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"require": {
"php": "~7.1",
"phpstan/phpstan": "^0.10",
"doctrine/common": "^2.7",
"doctrine/orm": "^2.5",
"doctrine/collections": "^1.0",
"nikic/php-parser": "^4.0"
},
"require-dev": {
Expand All @@ -25,7 +22,15 @@
"phpstan/phpstan-phpunit": "^0.10",
"phpstan/phpstan-strict-rules": "^0.10",
"phpunit/phpunit": "^7.0",
"slevomat/coding-standard": "^4.5.2"
"slevomat/coding-standard": "^4.5.2",
"doctrine/common": "^2.7",
"doctrine/orm": "^2.5",
"doctrine/collections": "^1.0"
},
"conflict": {
"doctrine/common": "<2.7",
"doctrine/orm": "<2.5",
"doctrine/collections": "<1.0"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace PHPStan\Reflection\Doctrine;

class DoctrineSelectableClassReflectionExtension implements \PHPStan\Reflection\MethodsClassReflectionExtension, \PHPStan\Reflection\BrokerAwareClassReflectionExtension
class DoctrineSelectableClassReflectionExtension implements \PHPStan\Reflection\MethodsClassReflectionExtension, \PHPStan\Reflection\BrokerAwareExtension
{

/** @var \PHPStan\Broker\Broker */
Expand All @@ -15,13 +15,13 @@ public function setBroker(\PHPStan\Broker\Broker $broker): void

public function hasMethod(\PHPStan\Reflection\ClassReflection $classReflection, string $methodName): bool
{
return $classReflection->getName() === \Doctrine\Common\Collections\Collection::class
return $classReflection->getName() === 'Doctrine\Common\Collections\Collection'
&& $methodName === 'matching';
}

public function getMethod(\PHPStan\Reflection\ClassReflection $classReflection, string $methodName): \PHPStan\Reflection\MethodReflection
{
$selectableReflection = $this->broker->getClass(\Doctrine\Common\Collections\Selectable::class);
$selectableReflection = $this->broker->getClass('Doctrine\Common\Collections\Selectable');
return $selectableReflection->getNativeMethod($methodName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DoctrineSelectableDynamicReturnTypeExtension implements \PHPStan\Type\Dyna

public function getClass(): string
{
return \Doctrine\Common\Collections\Collection::class;
return 'Doctrine\Common\Collections\Collection';
}

public function isMethodSupported(MethodReflection $methodReflection): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class EntityManagerFindDynamicReturnTypeExtension implements \PHPStan\Type\Dynam

public function getClass(): string
{
return \Doctrine\Common\Persistence\ObjectManager::class;
return 'Doctrine\Common\Persistence\ObjectManager';
}

public function isMethodSupported(MethodReflection $methodReflection): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(string $repositoryClass)

public function getClass(): string
{
return \Doctrine\Common\Persistence\ObjectManager::class;
return 'Doctrine\Common\Persistence\ObjectManager';
}

public function isMethodSupported(MethodReflection $methodReflection): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EntityRepositoryDynamicReturnTypeExtension implements \PHPStan\Type\Dynami

public function getClass(): string
{
return \Doctrine\ORM\EntityRepository::class;
return 'Doctrine\ORM\EntityRepository';
}

public function isMethodSupported(MethodReflection $methodReflection): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ObjectManagerMergeDynamicReturnTypeExtension implements \PHPStan\Type\Dyna

public function getClass(): string
{
return \Doctrine\Common\Persistence\ObjectManager::class;
return 'Doctrine\Common\Persistence\ObjectManager';
}

public function isMethodSupported(MethodReflection $methodReflection): bool
Expand Down