Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jan 13, 2025
1 parent 5a881aa commit f1c7b45
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 18 deletions.
54 changes: 36 additions & 18 deletions .phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -1801,12 +1801,6 @@
'count' => 1,
'path' => __DIR__ . '/src/Fieldblacklist.php',
];
$ignoreErrors[] = [
'message' => '#^Property GLPI\\:\\:\\$error_handler is unused\\.$#',
'identifier' => 'property.unused',
'count' => 1,
'path' => __DIR__ . '/src/GLPI.php',
];
$ignoreErrors[] = [
'message' => '#^Default value of the parameter \\#1 \\$config_dir \\(null\\) of method GLPIKey\\:\\:__construct\\(\\) is incompatible with type string\\.$#',
'identifier' => 'parameter.defaultValue',
Expand Down Expand Up @@ -2149,18 +2143,6 @@
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Api/HL/Search.php',
];
$ignoreErrors[] = [
'message' => '#^Default value of the parameter \\#2 \\$env \\(null\\) of method Glpi\\\\Application\\\\ErrorHandler\\:\\:__construct\\(\\) is incompatible with type string\\.$#',
'identifier' => 'parameter.defaultValue',
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Application/ErrorHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Strict comparison using \\!\\=\\= between null and \'comment\'\\|\'error\' will always evaluate to true\\.$#',
'identifier' => 'notIdentical.alwaysTrue',
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Application/ErrorHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Default value of the parameter \\#2 \\$cachedir \\(null\\) of method Glpi\\\\Application\\\\View\\\\TemplateRenderer\\:\\:__construct\\(\\) is incompatible with type string\\.$#',
'identifier' => 'parameter.defaultValue',
Expand Down Expand Up @@ -2587,6 +2569,30 @@
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Dropdown/Dropdown.php',
];
$ignoreErrors[] = [
'message' => '#^Class Glpi\\\\Error\\\\ErrorHandler extends @final class Symfony\\\\Component\\\\ErrorHandler\\\\ErrorHandler\\.$#',
'identifier' => 'class.extendsFinalByPhpDoc',
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Error/ErrorHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Default value of the parameter \\#4 \\$env \\(null\\) of method Glpi\\\\Error\\\\ErrorHandler\\:\\:displayErrorMessage\\(\\) is incompatible with type string\\.$#',
'identifier' => 'parameter.defaultValue',
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Error/ErrorHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Property Glpi\\\\Error\\\\ErrorHandler\\:\\:\\$env \\(string\\) does not accept null\\.$#',
'identifier' => 'assign.propertyType',
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Error/ErrorHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Strict comparison using \\=\\=\\= between null and \'development\' will always evaluate to false\\.$#',
'identifier' => 'identical.alwaysFalse',
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Error/ErrorHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Method Glpi\\\\Form\\\\AccessControl\\\\FormAccessControl\\:\\:getTabNameForItem\\(\\) never returns array\\<string\\> so it can be removed from the return type\\.$#',
'identifier' => 'return.unusedType',
Expand Down Expand Up @@ -3091,6 +3097,18 @@
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Kernel/Kernel.php',
];
$ignoreErrors[] = [
'message' => '#^Match arm comparison between null and \'development\' is always false\\.$#',
'identifier' => 'match.alwaysFalse',
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Log/GlpiLogHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Match arm comparison between null and \'testing\' is always false\\.$#',
'identifier' => 'match.alwaysFalse',
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Log/GlpiLogHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Negated boolean expression is always true\\.$#',
'identifier' => 'booleanNot.alwaysTrue',
Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ parameters:
ignoreErrors:
- '~Instantiated class XHProfRuns_Default not found~'
- '~Instantiation of deprecated class Glpi\\Http\\HeaderlessStreamedResponse~'
- '~Call to( deprecated)? method logException\(\) of( deprecated)? class Glpi\\Application\\ErrorUtils.~'
- '~Call to( deprecated)? method outputExceptionMessage\(\) of( deprecated)? class Glpi\\Application\\ErrorUtils.~'
- { message: '~Variable \$this might not be defined~', paths: [ 'inc/includes.php' ] }
- { message: '~Call to protected method setAjax\(\) of class Glpi\\Controller\\LegacyFileLoadController.~', paths: [ 'ajax/*', 'front/*', 'inc/includes.php' ] }
- { message: '~Access to protected property~', paths: [ 'front/dropdown.common.form.php' ] }
Expand Down

0 comments on commit f1c7b45

Please sign in to comment.