src/Controller/Api/GeoProviderController.php
/**
     * @internal    check AJAX request from views
     *
     * @return JsonResponse|string return an error response or the searchField
     */
@internal    check AJAX request from views
@return JsonResponse|string return an error response or the searchField
@internal check AJAX request from views @return JsonResponse|string return an error response or the searchField
private function isQueryStringInvalid(?string $searchQuery, string $searchField)
    {
        if (!$searchQuery || '' === $searchQuery) {
            $response = new JsonResponse(
                "$searchField query string can't be empty.",
                Response::HTTP_UNPROCESSABLE_ENTITY,
            );
            $response->headers->set('Content-Type', 'application/problem+json');
            return $response;
        }
        return $searchField;
    }
private function isQueryStringInvalid ( ? string $ searchQuery , string $ searchField ) { if ( ! $ searchQuery || '' === $ searchQuery ) { $ response = new JsonResponse ( " $ searchField  query string can't be empty. " , Response :: HTTP_UNPROCESSABLE_ENTITY , ) ; $ response -> headers -> set ( 'Content-Type' , 'application/problem+json' ) ; return $ response ; } return $ searchField ; }
@internal    check AJAX request from views
 @return JsonResponse|string return an error response or the searchField
@internal check AJAX request from views @return JsonResponse|string return an error response or the searchField