mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-05 21:09:43 +00:00
Rector changes and immplementations of required methods
This commit is contained in:
@@ -24,17 +24,17 @@ class UserCircleConsistency extends Constraint
|
||||
|
||||
public $role;
|
||||
|
||||
public function getDefaultOption()
|
||||
public function getDefaultOption(): ?string
|
||||
{
|
||||
return 'role';
|
||||
}
|
||||
|
||||
public function getRequiredOptions()
|
||||
public function getRequiredOptions(): array
|
||||
{
|
||||
return ['role'];
|
||||
}
|
||||
|
||||
public function getTargets()
|
||||
public function getTargets(): string|array
|
||||
{
|
||||
return self::CLASS_CONSTRAINT;
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ class UserCircleConsistencyValidator extends ConstraintValidator
|
||||
* @param object $value
|
||||
* @param UserCircleConsistency $constraint
|
||||
*/
|
||||
public function validate($value, Constraint $constraint)
|
||||
public function validate($value, Constraint $constraint): void
|
||||
{
|
||||
/** @var \Chill\MainBundle\Entity\User $user */
|
||||
$user = \call_user_func([$value, $constraint->getUserFunction]);
|
||||
|
@@ -22,17 +22,17 @@ class ExportElementConstraint extends Constraint
|
||||
{
|
||||
public $element;
|
||||
|
||||
public function getRequiredOptions()
|
||||
public function getRequiredOptions(): array
|
||||
{
|
||||
return ['element'];
|
||||
}
|
||||
|
||||
public function getTargets()
|
||||
public function getTargets(): string|array
|
||||
{
|
||||
return self::PROPERTY_CONSTRAINT;
|
||||
}
|
||||
|
||||
public function validatedBy()
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return ExportElementConstraintValidator::class;
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ use Symfony\Component\Validator\ConstraintValidator;
|
||||
*/
|
||||
class ExportElementConstraintValidator extends ConstraintValidator
|
||||
{
|
||||
public function validate($value, Constraint $constraint)
|
||||
public function validate($value, Constraint $constraint): void
|
||||
{
|
||||
if ($constraint->element instanceof ExportElementValidatedInterface) {
|
||||
if (true === $value['enabled']) {
|
||||
|
Reference in New Issue
Block a user