src/Query.php
protected function checkSubQueryValue(string $name, $value)
    {
        if (
            !($value instanceof \Closure) &&
            !($value instanceof self) &&
            !($value instanceof StatementInterface)
        ) {
            return $this->handleException(InvalidArgumentException::create(
                $name,
                $value,
                [\Closure::class, self::class, StatementInterface::class]
            ));
        }

        if ($value instanceof \Closure) {
            $value = $this->resolveSubQueryClosure($value);
        }

        return $value;
    }
protected function checkSubQueryValue(string $name, $value)
    {
        if (
            !($value instanceof \Closure) &&
            !($value instanceof self) &&
            !($value instanceof StatementInterface)
        ) {
            return $this->handleException(InvalidArgumentException::create(
                $name,
                $value,
                [\Closure::class, self::class, StatementInterface::class]
            ));
        }

        if ($value instanceof \Closure) {
            $value = $this->resolveSubQueryClosure($value);
        }

        return $value;
    }
protected function checkSubQueryValue ( string $ name , $ value ) { if ( ! ( $ value instanceof \ Closure ) && ! ( $ value instanceof self ) && ! ( $ value instanceof StatementInterface ) ) { return $ this -> handleException ( InvalidArgumentException :: create ( $ name , $ value , [ \ Closure :: class , self :: class , StatementInterface :: class ] ) ) ; } if ( $ value instanceof \ Closure ) { $ value = $ this -> resolveSubQueryClosure ( $ value ) ; } return $ value ; }
Check that value is suitable for being a subquery property of a query. Retrieves the closure subquery.

@param string $name Value name
@param \Closure|self|StatementInterface $value
@return self|StatementInterface
@throws InvalidArgumentException
@throws InvalidReturnValueException
Check that value is suitable for being a subquery property of a query . Retrieves the closure subquery .