Skip to content

Commit a0314b1

Browse files
lookymanondrejmirtes
authored andcommitted
Replaced some requirements with conflicts
1 parent 719ea82 commit a0314b1

7 files changed

+17
-12
lines changed

composer.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
"require": {
1313
"php": "~7.1",
1414
"phpstan/phpstan": "^0.10",
15-
"doctrine/common": "^2.7",
16-
"doctrine/orm": "^2.5",
17-
"doctrine/collections": "^1.0",
1815
"nikic/php-parser": "^4.0"
1916
},
2017
"require-dev": {
@@ -25,7 +22,15 @@
2522
"phpstan/phpstan-phpunit": "^0.10",
2623
"phpstan/phpstan-strict-rules": "^0.10",
2724
"phpunit/phpunit": "^7.0",
28-
"slevomat/coding-standard": "^4.5.2"
25+
"slevomat/coding-standard": "^4.5.2",
26+
"doctrine/common": "^2.7",
27+
"doctrine/orm": "^2.5",
28+
"doctrine/collections": "^1.0"
29+
},
30+
"conflict": {
31+
"doctrine/common": "<2.7",
32+
"doctrine/orm": "<2.5",
33+
"doctrine/collections": "<1.0"
2934
},
3035
"autoload": {
3136
"psr-4": {

src/Reflection/Doctrine/DoctrineSelectableClassReflectionExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace PHPStan\Reflection\Doctrine;
44

5-
class DoctrineSelectableClassReflectionExtension implements \PHPStan\Reflection\MethodsClassReflectionExtension, \PHPStan\Reflection\BrokerAwareClassReflectionExtension
5+
class DoctrineSelectableClassReflectionExtension implements \PHPStan\Reflection\MethodsClassReflectionExtension, \PHPStan\Reflection\BrokerAwareExtension
66
{
77

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

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

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

src/Type/Doctrine/DoctrineSelectableDynamicReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class DoctrineSelectableDynamicReturnTypeExtension implements \PHPStan\Type\Dyna
1212

1313
public function getClass(): string
1414
{
15-
return \Doctrine\Common\Collections\Collection::class;
15+
return 'Doctrine\Common\Collections\Collection';
1616
}
1717

1818
public function isMethodSupported(MethodReflection $methodReflection): bool

src/Type/Doctrine/EntityManagerFindDynamicReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class EntityManagerFindDynamicReturnTypeExtension implements \PHPStan\Type\Dynam
1616

1717
public function getClass(): string
1818
{
19-
return \Doctrine\Common\Persistence\ObjectManager::class;
19+
return 'Doctrine\Common\Persistence\ObjectManager';
2020
}
2121

2222
public function isMethodSupported(MethodReflection $methodReflection): bool

src/Type/Doctrine/EntityManagerGetRepositoryDynamicReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(string $repositoryClass)
2323

2424
public function getClass(): string
2525
{
26-
return \Doctrine\Common\Persistence\ObjectManager::class;
26+
return 'Doctrine\Common\Persistence\ObjectManager';
2727
}
2828

2929
public function isMethodSupported(MethodReflection $methodReflection): bool

src/Type/Doctrine/EntityRepositoryDynamicReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class EntityRepositoryDynamicReturnTypeExtension implements \PHPStan\Type\Dynami
1717

1818
public function getClass(): string
1919
{
20-
return \Doctrine\ORM\EntityRepository::class;
20+
return 'Doctrine\ORM\EntityRepository';
2121
}
2222

2323
public function isMethodSupported(MethodReflection $methodReflection): bool

src/Type/Doctrine/ObjectManagerMergeDynamicReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ObjectManagerMergeDynamicReturnTypeExtension implements \PHPStan\Type\Dyna
1313

1414
public function getClass(): string
1515
{
16-
return \Doctrine\Common\Persistence\ObjectManager::class;
16+
return 'Doctrine\Common\Persistence\ObjectManager';
1717
}
1818

1919
public function isMethodSupported(MethodReflection $methodReflection): bool

0 commit comments

Comments
 (0)