mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix code syntax using php stan
This commit is contained in:
parent
3c3d63e286
commit
15c7c6ccde
@ -289,7 +289,7 @@ class ActivityType extends AbstractType
|
||||
if (null === $thirdpartyAsString) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
return array_map(
|
||||
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
|
||||
explode(',', $thirdpartyAsString)
|
||||
|
@ -186,7 +186,7 @@ class HouseholdMemberController extends ApiController
|
||||
$_format,
|
||||
['groups' => ['read']]
|
||||
);
|
||||
} catch (Exception\InvalidArgumentException|Exception\UnexpectedValueException $e) {
|
||||
} catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) {
|
||||
throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e);
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,9 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Resource;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity;
|
||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap;
|
||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck;
|
||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
|
@ -24,4 +24,4 @@ class AccompanyingPeriodValidity extends Constraint
|
||||
{
|
||||
return self::CLASS_CONSTRAINT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,10 +17,10 @@ use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||
use function in_array;
|
||||
|
||||
class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
||||
{
|
||||
|
||||
private ActivityACLAwareRepository $activityRepository;
|
||||
|
||||
public function __construct(ActivityACLAwareRepository $activityRepository)
|
||||
@ -30,7 +30,6 @@ class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
||||
|
||||
public function validate($period, Constraint $constraint)
|
||||
{
|
||||
|
||||
if (!$constraint instanceof AccompanyingPeriodValidity) {
|
||||
throw new UnexpectedTypeException($constraint, AccompanyingPeriodValidity::class);
|
||||
}
|
||||
@ -60,6 +59,5 @@ class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user