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) {
|
if (null === $thirdpartyAsString) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_map(
|
return array_map(
|
||||||
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
|
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
|
||||||
explode(',', $thirdpartyAsString)
|
explode(',', $thirdpartyAsString)
|
||||||
|
@ -186,7 +186,7 @@ class HouseholdMemberController extends ApiController
|
|||||||
$_format,
|
$_format,
|
||||||
['groups' => ['read']]
|
['groups' => ['read']]
|
||||||
);
|
);
|
||||||
} catch (Exception\InvalidArgumentException|Exception\UnexpectedValueException $e) {
|
} catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) {
|
||||||
throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $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\Origin;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Resource;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\Resource;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
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\ParticipationOverlap;
|
||||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck;
|
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck;
|
||||||
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity;
|
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
|
@ -24,4 +24,4 @@ class AccompanyingPeriodValidity extends Constraint
|
|||||||
{
|
{
|
||||||
return self::CLASS_CONSTRAINT;
|
return self::CLASS_CONSTRAINT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,10 @@ use Symfony\Component\Validator\Constraint;
|
|||||||
use Symfony\Component\Validator\ConstraintValidator;
|
use Symfony\Component\Validator\ConstraintValidator;
|
||||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||||
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||||
|
use function in_array;
|
||||||
|
|
||||||
class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
||||||
{
|
{
|
||||||
|
|
||||||
private ActivityACLAwareRepository $activityRepository;
|
private ActivityACLAwareRepository $activityRepository;
|
||||||
|
|
||||||
public function __construct(ActivityACLAwareRepository $activityRepository)
|
public function __construct(ActivityACLAwareRepository $activityRepository)
|
||||||
@ -30,7 +30,6 @@ class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
|||||||
|
|
||||||
public function validate($period, Constraint $constraint)
|
public function validate($period, Constraint $constraint)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!$constraint instanceof AccompanyingPeriodValidity) {
|
if (!$constraint instanceof AccompanyingPeriodValidity) {
|
||||||
throw new UnexpectedTypeException($constraint, AccompanyingPeriodValidity::class);
|
throw new UnexpectedTypeException($constraint, AccompanyingPeriodValidity::class);
|
||||||
}
|
}
|
||||||
@ -60,6 +59,5 @@ class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
|||||||
->addViolation();
|
->addViolation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user