2
2
3
3
namespace PHPStan \Type \Doctrine \Descriptors ;
4
4
5
- use PHPStan \Broker \Broker ;
6
5
use PHPStan \Reflection \ParametersAcceptorSelector ;
6
+ use PHPStan \Reflection \ReflectionProvider ;
7
7
use PHPStan \Type \MixedType ;
8
8
use PHPStan \Type \Type ;
9
9
use PHPStan \Type \TypeCombinator ;
@@ -14,16 +14,16 @@ class ReflectionDescriptor implements DoctrineTypeDescriptor
14
14
/** @var class-string<\Doctrine\DBAL\Types\Type> */
15
15
private $ type ;
16
16
17
- /** @var Broker */
18
- private $ broker ;
17
+ /** @var ReflectionProvider */
18
+ private $ reflectionProvider ;
19
19
20
20
/**
21
21
* @param class-string<\Doctrine\DBAL\Types\Type> $type
22
22
*/
23
- public function __construct (string $ type , Broker $ broker )
23
+ public function __construct (string $ type , ReflectionProvider $ reflectionProvider )
24
24
{
25
25
$ this ->type = $ type ;
26
- $ this ->broker = $ broker ;
26
+ $ this ->reflectionProvider = $ reflectionProvider ;
27
27
}
28
28
29
29
public function getType (): string
@@ -33,14 +33,14 @@ public function getType(): string
33
33
34
34
public function getWritableToPropertyType (): Type
35
35
{
36
- $ type = ParametersAcceptorSelector::selectSingle ($ this ->broker ->getClass ($ this ->type )->getNativeMethod ('convertToPHPValue ' )->getVariants ())->getReturnType ();
36
+ $ type = ParametersAcceptorSelector::selectSingle ($ this ->reflectionProvider ->getClass ($ this ->type )->getNativeMethod ('convertToPHPValue ' )->getVariants ())->getReturnType ();
37
37
38
38
return TypeCombinator::removeNull ($ type );
39
39
}
40
40
41
41
public function getWritableToDatabaseType (): Type
42
42
{
43
- $ type = ParametersAcceptorSelector::selectSingle ($ this ->broker ->getClass ($ this ->type )->getNativeMethod ('convertToDatabaseValue ' )->getVariants ())->getParameters ()[0 ]->getType ();
43
+ $ type = ParametersAcceptorSelector::selectSingle ($ this ->reflectionProvider ->getClass ($ this ->type )->getNativeMethod ('convertToDatabaseValue ' )->getVariants ())->getParameters ()[0 ]->getType ();
44
44
45
45
return TypeCombinator::removeNull ($ type );
46
46
}
0 commit comments