22
33namespace PHPStan \Type \Doctrine \Descriptors ;
44
5- use PHPStan \Broker \Broker ;
65use PHPStan \Reflection \ParametersAcceptorSelector ;
6+ use PHPStan \Reflection \ReflectionProvider ;
77use PHPStan \Type \MixedType ;
88use PHPStan \Type \Type ;
99use PHPStan \Type \TypeCombinator ;
@@ -14,16 +14,16 @@ class ReflectionDescriptor implements DoctrineTypeDescriptor
1414 /** @var class-string<\Doctrine\DBAL\Types\Type> */
1515 private $ type ;
1616
17- /** @var Broker */
18- private $ broker ;
17+ /** @var ReflectionProvider */
18+ private $ reflectionProvider ;
1919
2020 /**
2121 * @param class-string<\Doctrine\DBAL\Types\Type> $type
2222 */
23- public function __construct (string $ type , Broker $ broker )
23+ public function __construct (string $ type , ReflectionProvider $ reflectionProvider )
2424 {
2525 $ this ->type = $ type ;
26- $ this ->broker = $ broker ;
26+ $ this ->reflectionProvider = $ reflectionProvider ;
2727 }
2828
2929 public function getType (): string
@@ -33,14 +33,14 @@ public function getType(): string
3333
3434 public function getWritableToPropertyType (): Type
3535 {
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 ();
3737
3838 return TypeCombinator::removeNull ($ type );
3939 }
4040
4141 public function getWritableToDatabaseType (): Type
4242 {
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 ();
4444
4545 return TypeCombinator::removeNull ($ type );
4646 }
0 commit comments