mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-01 14:36:13 +00:00
cs: Enable risky rule is_null
.
This commit is contained in:
parent
e11c249131
commit
3631fd99fd
@ -36,7 +36,7 @@ $riskyRules = [
|
|||||||
'php_unit_no_expectation_annotation' => false,
|
'php_unit_no_expectation_annotation' => false,
|
||||||
'declare_strict_types' => false,
|
'declare_strict_types' => false,
|
||||||
'function_to_constant' => false,
|
'function_to_constant' => false,
|
||||||
'is_null' => false,
|
'is_null' => true,
|
||||||
'native_function_invocation' => false,
|
'native_function_invocation' => false,
|
||||||
'ternary_to_elvis_operator' => false,
|
'ternary_to_elvis_operator' => false,
|
||||||
// 'no_trailing_whitespace_in_string' => false,
|
// 'no_trailing_whitespace_in_string' => false,
|
||||||
|
@ -520,8 +520,8 @@ class ExportManager
|
|||||||
if ($element instanceof ExportInterface || $element instanceof DirectExportInterface) {
|
if ($element instanceof ExportInterface || $element instanceof DirectExportInterface) {
|
||||||
$role = $element->requiredRole();
|
$role = $element->requiredRole();
|
||||||
} elseif ($element instanceof ModifierInterface) {
|
} elseif ($element instanceof ModifierInterface) {
|
||||||
if (is_null($element->addRole())) {
|
if (null === $element->addRole()) {
|
||||||
if (is_null($export)) {
|
if (null === $export) {
|
||||||
throw new LogicException('The export should not be null: as the '
|
throw new LogicException('The export should not be null: as the '
|
||||||
. 'ModifierInstance element is not an export, we should '
|
. 'ModifierInstance element is not an export, we should '
|
||||||
. 'be aware of the export to determine which role is required');
|
. 'be aware of the export to determine which role is required');
|
||||||
|
@ -342,20 +342,17 @@ class SpreadSheetFormatter implements FormatterInterface
|
|||||||
|
|
||||||
switch ($this->formatterData['format']) {
|
switch ($this->formatterData['format']) {
|
||||||
case 'ods':
|
case 'ods':
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Ods');
|
||||||
::createWriter($spreadsheet, 'Ods');
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'xlsx':
|
case 'xlsx':
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
::createWriter($spreadsheet, 'Xlsx');
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'csv':
|
case 'csv':
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Csv');
|
||||||
::createWriter($spreadsheet, 'Csv');
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -167,23 +167,20 @@ class SpreadsheetListFormatter implements FormatterInterface
|
|||||||
|
|
||||||
switch ($this->formatterData['format']) {
|
switch ($this->formatterData['format']) {
|
||||||
case 'ods':
|
case 'ods':
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Ods');
|
||||||
::createWriter($spreadsheet, 'Ods');
|
|
||||||
$contentType = 'application/vnd.oasis.opendocument.spreadsheet';
|
$contentType = 'application/vnd.oasis.opendocument.spreadsheet';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'xlsx':
|
case 'xlsx':
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
::createWriter($spreadsheet, 'Xlsx');
|
|
||||||
$contentType = 'application/vnd.openxmlformats-officedocument.'
|
$contentType = 'application/vnd.openxmlformats-officedocument.'
|
||||||
. 'spreadsheetml.sheet';
|
. 'spreadsheetml.sheet';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'csv':
|
case 'csv':
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Csv');
|
||||||
::createWriter($spreadsheet, 'Csv');
|
|
||||||
$contentType = 'text/csv';
|
$contentType = 'text/csv';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -69,7 +69,7 @@ class RoleScopeScopePresence extends ConstraintValidator
|
|||||||
} elseif // if the scope should be null
|
} elseif // if the scope should be null
|
||||||
(
|
(
|
||||||
in_array($value->getRole(), $this->roleProvider->getRolesWithoutScopes())
|
in_array($value->getRole(), $this->roleProvider->getRolesWithoutScopes())
|
||||||
&& !is_null($value->getScope())
|
&& null !== $value->getScope()
|
||||||
) {
|
) {
|
||||||
$this->context->buildViolation($constraint->messageNullRequired)
|
$this->context->buildViolation($constraint->messageNullRequired)
|
||||||
->setParameter('%role%', $this->translator->trans($value->getRole()))
|
->setParameter('%role%', $this->translator->trans($value->getRole()))
|
||||||
|
@ -183,7 +183,7 @@ class HouseholdMemberController extends ApiController
|
|||||||
$_format,
|
$_format,
|
||||||
['groups' => ['read']]
|
['groups' => ['read']]
|
||||||
);
|
);
|
||||||
} catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) {
|
} catch (Exception\InvalidArgumentException|Exception\UnexpectedValueException $e) {
|
||||||
throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e);
|
throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user