apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -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');
}