mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-07 05:49:42 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -19,8 +19,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
use function array_map;
|
||||
|
||||
/**
|
||||
* Class PostalCodeController.
|
||||
*/
|
||||
@@ -55,21 +53,21 @@ class PostalCodeController extends AbstractController
|
||||
->createQuery(
|
||||
sprintf(
|
||||
'SELECT p.id AS id, p.name AS name, p.code AS code, '
|
||||
. 'country.name AS country_name, '
|
||||
. 'country.countryCode AS country_code '
|
||||
. 'FROM %s p '
|
||||
. 'JOIN p.country country '
|
||||
. 'WHERE LOWER(p.name) LIKE LOWER(:pattern) OR LOWER(p.code) LIKE LOWER(:pattern) '
|
||||
. 'ORDER BY code',
|
||||
.'country.name AS country_name, '
|
||||
.'country.countryCode AS country_code '
|
||||
.'FROM %s p '
|
||||
.'JOIN p.country country '
|
||||
.'WHERE LOWER(p.name) LIKE LOWER(:pattern) OR LOWER(p.code) LIKE LOWER(:pattern) '
|
||||
.'ORDER BY code',
|
||||
PostalCode::class
|
||||
)
|
||||
)
|
||||
->setParameter('pattern', '%' . $pattern . '%')
|
||||
->setParameter('pattern', '%'.$pattern.'%')
|
||||
->setMaxResults(30);
|
||||
|
||||
$results = array_map(function ($row) {
|
||||
$results = \array_map(function ($row) {
|
||||
$row['country_name'] = $this->translatableStringHelper->localize($row['country_name']);
|
||||
$row['text'] = $row['code'] . ' ' . $row['name'] . ' (' . $row['country_name'] . ')';
|
||||
$row['text'] = $row['code'].' '.$row['name'].' ('.$row['country_name'].')';
|
||||
|
||||
return $row;
|
||||
}, $query->getResult(Query::HYDRATE_ARRAY));
|
||||
|
Reference in New Issue
Block a user