File tree Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -53,25 +53,23 @@ function getBuilderMethod($method, $factory)
53
53
];
54
54
}
55
55
56
- function getCastReturnType ($ classname )
56
+ function getCastReturnType ($ className )
57
57
{
58
- if ($ classname === null ) {
58
+ if ($ className === null ) {
59
59
return null ;
60
60
}
61
61
62
- $ returnType = $ classname ;
63
-
64
62
try {
65
- $ class = new \ReflectionClass ($ classname );
63
+ $ class = new \ReflectionClass ($ className );
66
64
$ method = $ class ->getMethod ('get ' );
67
65
68
66
if ($ method ->hasReturnType ()) {
69
- $ returnType = $ method ->getReturnType ()->getName ();
67
+ return $ method ->getReturnType ()->getName ();
70
68
}
71
69
72
- return $ returnType ;
70
+ return $ className ;
73
71
} catch (\Exception | \Throwable $ e ) {
74
- return $ returnType ;
72
+ return $ className ;
75
73
}
76
74
}
77
75
Original file line number Diff line number Diff line change @@ -53,25 +53,25 @@ function getBuilderMethod($method, $factory)
53
53
];
54
54
}
55
55
56
- function getCastReturnType($classname )
56
+ function getCastReturnType($className )
57
57
{
58
- if ($classname === null) {
58
+ return $className;
59
+
60
+ if ($className === null) {
59
61
return null;
60
62
}
61
63
62
- $returnType = $classname;
63
-
64
64
try {
65
- $class = new \\ReflectionClass($classname );
65
+ $class = new \\ReflectionClass($className );
66
66
$method = $class->getMethod('get');
67
67
68
68
if ($method->hasReturnType()) {
69
- $returnType = $method->getReturnType()->getName();
69
+ return $method->getReturnType()->getName();
70
70
}
71
71
72
- return $returnType ;
72
+ return $className ;
73
73
} catch (\\Exception | \\Throwable $e) {
74
- return $returnType ;
74
+ return $className ;
75
75
}
76
76
}
77
77
You can’t perform that action at this time.
0 commit comments