mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
fix phpstan issues
This commit is contained in:
@@ -258,7 +258,9 @@ class ApiController extends AbstractCRUDController
|
||||
}
|
||||
|
||||
match ($request->getMethod()) {
|
||||
/* @phpstan-ignore-next-line */
|
||||
Request::METHOD_DELETE => $entity->{'remove' . ucfirst($property)}($postedData),
|
||||
/* @phpstan-ignore-next-line */
|
||||
Request::METHOD_POST => $entity->{'add' . ucfirst($property)}($postedData),
|
||||
default => throw new BadRequestHttpException('this method is not supported'),
|
||||
};
|
||||
|
@@ -209,9 +209,9 @@ class AuthorizationHelper implements AuthorizationHelperInterface
|
||||
|
||||
throw new UnexpectedValueException(
|
||||
sprintf(
|
||||
'The entity given is not an instance of %s, %s given',
|
||||
'The entity given is not an instance of %s or an array of centers, %s given',
|
||||
Center::class,
|
||||
$center::class
|
||||
gettype($center)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@@ -23,25 +23,15 @@ class PasswordRecoverEvent extends Event
|
||||
public const INVALID_TOKEN = 'chill_main.password_recover_invalid_token';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $safelyGenerated;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* @param type $token
|
||||
* @param User $user
|
||||
* @param type $ip
|
||||
* @param bool $safelyGenerated true if generated safely (from console command, etc.)
|
||||
*/
|
||||
public function __construct(protected $token = null, ?User $user = null, protected $ip = null, bool $safelyGenerated = false)
|
||||
public function __construct(
|
||||
private ?string $token = null,
|
||||
private ?User $user = null,
|
||||
private $ip = null,
|
||||
private bool $safelyGenerated = false,
|
||||
)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->safelyGenerated = $safelyGenerated;
|
||||
}
|
||||
|
||||
public function getIp()
|
||||
|
@@ -87,7 +87,6 @@ class RollingDateConverter implements RollingDateConverterInterface
|
||||
4, 5, 6 => '04',
|
||||
7, 8, 9 => '07',
|
||||
10, 11, 12 => '10',
|
||||
default => throw new LogicException('this month is not valid: ' . $date->format('n')),
|
||||
};
|
||||
|
||||
return DateTimeImmutable::createFromFormat(
|
||||
|
Reference in New Issue
Block a user