mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -22,16 +22,12 @@ use Chill\PersonBundle\Event\Person\PersonAddressMoveEvent;
|
||||
use Chill\PersonBundle\Repository\Household\HouseholdACLAwareRepositoryInterface;
|
||||
use Chill\PersonBundle\Repository\Household\HouseholdRepository;
|
||||
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
|
||||
use DateTimeImmutable;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
use function array_filter;
|
||||
use function array_values;
|
||||
|
||||
class HouseholdApiController extends ApiController
|
||||
{
|
||||
@@ -79,9 +75,9 @@ class HouseholdApiController extends ApiController
|
||||
$household->addAddress($address);
|
||||
|
||||
foreach ($household->getMembersOnRange(
|
||||
DateTimeImmutable::createFromMutable($address->getValidFrom()),
|
||||
\DateTimeImmutable::createFromMutable($address->getValidFrom()),
|
||||
null === $address->getValidTo() ? null :
|
||||
DateTimeImmutable::createFromMutable($address->getValidTo())
|
||||
\DateTimeImmutable::createFromMutable($address->getValidTo())
|
||||
) as $member) {
|
||||
/** @var HouseholdMember $member */
|
||||
$event = new PersonAddressMoveEvent($member->getPerson());
|
||||
@@ -114,6 +110,7 @@ class HouseholdApiController extends ApiController
|
||||
* "_format": "json"
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* @ParamConverter("household", options={"id": "household_id"})
|
||||
*/
|
||||
public function suggestAddressByHousehold(Household $household, string $_format)
|
||||
@@ -146,11 +143,11 @@ class HouseholdApiController extends ApiController
|
||||
$actual = $household->getCurrentAddress();
|
||||
|
||||
if (null !== $actual) {
|
||||
$addresses = array_filter($addresses, static fn ($a) => $a !== $actual);
|
||||
$addresses = \array_filter($addresses, static fn ($a) => $a !== $actual);
|
||||
}
|
||||
|
||||
return $this->json(
|
||||
array_values($addresses),
|
||||
\array_values($addresses),
|
||||
Response::HTTP_OK,
|
||||
[],
|
||||
['groups' => ['read']]
|
||||
@@ -186,7 +183,7 @@ class HouseholdApiController extends ApiController
|
||||
}
|
||||
|
||||
if (null !== $currentHouseholdPerson) {
|
||||
$count = $count - 1;
|
||||
--$count;
|
||||
$paginator = $this->getPaginatorFactory()->create($count);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user