mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-01 06:26:15 +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,
|
||||
'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,
|
||||
|
@ -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');
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user