mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 14:54:57 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -19,9 +19,6 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
use function json_decode;
|
||||
|
||||
class PermissionApiController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly Security $security) {}
|
||||
@@ -35,21 +32,17 @@ class PermissionApiController extends AbstractController
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_USER');
|
||||
|
||||
$data = json_decode($request->getContent(), true);
|
||||
$data = \json_decode($request->getContent(), true);
|
||||
|
||||
if (null === $data) {
|
||||
throw new BadRequestHttpException(sprintf(
|
||||
'Could not decode json received, or data invalid: %s, %s',
|
||||
json_last_error(),
|
||||
json_last_error_msg()
|
||||
));
|
||||
throw new BadRequestHttpException(sprintf('Could not decode json received, or data invalid: %s, %s', json_last_error(), json_last_error_msg()));
|
||||
}
|
||||
|
||||
if (!array_key_exists('object', $data)) {
|
||||
if (!\array_key_exists('object', $data)) {
|
||||
throw new BadRequestHttpException('the object key is not present');
|
||||
}
|
||||
|
||||
if (!array_key_exists('class', $data)) {
|
||||
if (!\array_key_exists('class', $data)) {
|
||||
throw new BadRequestHttpException('the class key is not present');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user