@@ -33,9 +33,9 @@ public static function setupReflector(QueryReflector $reflector): void
3333 self ::$ reflector = $ reflector ;
3434 }
3535
36- public function validateQueryString (Expr $ expr , Scope $ scope ): ?Error
36+ public function validateQueryString (string $ queryString ): ?Error
3737 {
38- $ queryString = $ this ->builtSimulatedQuery ($ expr , $ scope );
38+ $ queryString = $ this ->builtSimulatedQuery ($ queryString );
3939
4040 if (null === $ queryString ) {
4141 return null ;
@@ -47,9 +47,9 @@ public function validateQueryString(Expr $expr, Scope $scope): ?Error
4747 /**
4848 * @param QueryReflector::FETCH_TYPE* $fetchType
4949 */
50- public function getResultType (Expr $ expr , Scope $ scope , int $ fetchType ): ?Type
50+ public function getResultType (string $ queryString , int $ fetchType ): ?Type
5151 {
52- $ queryString = $ this ->builtSimulatedQuery ($ expr , $ scope );
52+ $ queryString = $ this ->builtSimulatedQuery ($ queryString );
5353
5454 if (null === $ queryString ) {
5555 return null ;
@@ -58,14 +58,8 @@ public function getResultType(Expr $expr, Scope $scope, int $fetchType): ?Type
5858 return self ::reflector ()->getResultType ($ queryString , $ fetchType );
5959 }
6060
61- private function builtSimulatedQuery (Expr $ expr , Scope $ scope ): ?string
61+ private function builtSimulatedQuery (string $ queryString ): ?string
6262 {
63- $ queryString = $ this ->resolveQueryString ($ expr , $ scope );
64-
65- if (null === $ queryString ) {
66- return null ;
67- }
68-
6963 if ('SELECT ' !== $ this ->getQueryType ($ queryString )) {
7064 return null ;
7165 }
@@ -78,7 +72,7 @@ private function builtSimulatedQuery(Expr $expr, Scope $scope): ?string
7872 return $ queryString ;
7973 }
8074
81- private function resolveQueryString (Expr $ expr , Scope $ scope ): ?string
75+ public function resolveQueryString (Expr $ expr , Scope $ scope ): ?string
8276 {
8377 if ($ expr instanceof Concat) {
8478 $ left = $ expr ->left ;
0 commit comments