diff --git a/.php_cs.dist.php b/.php_cs.dist.php index 6f791684f..6b7c1ddb9 100644 --- a/.php_cs.dist.php +++ b/.php_cs.dist.php @@ -36,7 +36,7 @@ $riskyRules = [ 'php_unit_no_expectation_annotation' => false, 'declare_strict_types' => false, 'function_to_constant' => false, - 'is_null' => false, + 'is_null' => true, 'native_function_invocation' => false, 'ternary_to_elvis_operator' => false, // 'no_trailing_whitespace_in_string' => false, diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php index 954658b81..70ba2881f 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportManager.php +++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php @@ -520,8 +520,8 @@ class ExportManager if ($element instanceof ExportInterface || $element instanceof DirectExportInterface) { $role = $element->requiredRole(); } elseif ($element instanceof ModifierInterface) { - if (is_null($element->addRole())) { - if (is_null($export)) { + if (null === $element->addRole()) { + if (null === $export) { throw new LogicException('The export should not be null: as the ' . 'ModifierInstance element is not an export, we should ' . 'be aware of the export to determine which role is required'); diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php index 71119205e..3646c9610 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php @@ -342,20 +342,17 @@ class SpreadSheetFormatter implements FormatterInterface switch ($this->formatterData['format']) { case 'ods': - $writer = \PhpOffice\PhpSpreadsheet\IOFactory - ::createWriter($spreadsheet, 'Ods'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Ods'); break; case 'xlsx': - $writer = \PhpOffice\PhpSpreadsheet\IOFactory - ::createWriter($spreadsheet, 'Xlsx'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx'); break; case 'csv': - $writer = \PhpOffice\PhpSpreadsheet\IOFactory - ::createWriter($spreadsheet, 'Csv'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Csv'); break; diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php index e4fb8cf19..17bb8380e 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php @@ -167,23 +167,20 @@ class SpreadsheetListFormatter implements FormatterInterface switch ($this->formatterData['format']) { case 'ods': - $writer = \PhpOffice\PhpSpreadsheet\IOFactory - ::createWriter($spreadsheet, 'Ods'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Ods'); $contentType = 'application/vnd.oasis.opendocument.spreadsheet'; break; case 'xlsx': - $writer = \PhpOffice\PhpSpreadsheet\IOFactory - ::createWriter($spreadsheet, 'Xlsx'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx'); $contentType = 'application/vnd.openxmlformats-officedocument.' . 'spreadsheetml.sheet'; break; case 'csv': - $writer = \PhpOffice\PhpSpreadsheet\IOFactory - ::createWriter($spreadsheet, 'Csv'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Csv'); $contentType = 'text/csv'; break; diff --git a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php index 09c03f3ef..bce230ebb 100644 --- a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php +++ b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php @@ -69,7 +69,7 @@ class RoleScopeScopePresence extends ConstraintValidator } elseif // if the scope should be null ( in_array($value->getRole(), $this->roleProvider->getRolesWithoutScopes()) - && !is_null($value->getScope()) + && null !== $value->getScope() ) { $this->context->buildViolation($constraint->messageNullRequired) ->setParameter('%role%', $this->translator->trans($value->getRole())) diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php index 01f72ceb1..ef50057a0 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php @@ -183,7 +183,7 @@ class HouseholdMemberController extends ApiController $_format, ['groups' => ['read']] ); - } catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) { + } catch (Exception\InvalidArgumentException|Exception\UnexpectedValueException $e) { throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e); }