fix: SA: Fix "...Short ternary operator..." rule.

SA stands for Static Analysis.
This commit is contained in:
Pol Dellaiera 2021-11-16 15:14:43 +01:00
parent 5a85d497ab
commit e2a8437807
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
2 changed files with 1 additions and 6 deletions

View File

@ -20,11 +20,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php path: src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 1
path: src/Bundle/ChillDocStoreBundle/EntityRepository/DocumentCategoryRepository.php
- -
message: "#^Variable \\$participation might not be defined\\.$#" message: "#^Variable \\$participation might not be defined\\.$#"
count: 3 count: 3

View File

@ -34,6 +34,6 @@ class DocumentCategoryRepository extends EntityRepository
'SELECT MAX(c.idInsideBundle) + 1 FROM ChillDocStoreBundle:DocumentCategory c') 'SELECT MAX(c.idInsideBundle) + 1 FROM ChillDocStoreBundle:DocumentCategory c')
->getSingleResult(); ->getSingleResult();
return $array_res[1] ?: 0; return reset($array_res);
} }
} }