diff --git a/system/Boot.php b/system/Boot.php index 720c65facb43..ba3675516b16 100644 --- a/system/Boot.php +++ b/system/Boot.php @@ -373,9 +373,8 @@ protected static function initializeConsole(): Console $console = new Console(); // Show basic information before we do anything else. - // @phpstan-ignore-next-line if (is_int($suppress = array_search('--no-header', $_SERVER['argv'], true))) { - unset($_SERVER['argv'][$suppress]); // @phpstan-ignore-line + unset($_SERVER['argv'][$suppress]); $suppress = true; } diff --git a/utils/phpstan-baseline/codeigniter.superglobalAccess.neon b/utils/phpstan-baseline/codeigniter.superglobalAccess.neon index 893b1cd96c62..05153d87fb35 100644 --- a/utils/phpstan-baseline/codeigniter.superglobalAccess.neon +++ b/utils/phpstan-baseline/codeigniter.superglobalAccess.neon @@ -1,4 +1,4 @@ -# total 79 errors +# total 77 errors parameters: ignoreErrors: @@ -12,11 +12,6 @@ parameters: count: 1 path: ../../system/CLI/CLI.php - - - message: '#^Accessing offset ''argv'' directly on \$_SERVER is discouraged\.$#' - count: 1 - path: ../../system/CLI/CLI.php - - message: '#^Accessing offset ''encryption\.key'' directly on \$_SERVER is discouraged\.$#' count: 1 @@ -152,11 +147,6 @@ parameters: count: 1 path: ../../tests/system/CLI/ConsoleTest.php - - - message: '#^Accessing offset ''argv'' directly on \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CLI/ConsoleTest.php - - message: '#^Accessing offset ''encryption\.key'' directly on \$_SERVER is discouraged\.$#' count: 1 diff --git a/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon b/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon index 3322897a77f8..4e5600bcc34c 100644 --- a/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon +++ b/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon @@ -1,4 +1,4 @@ -# total 581 errors +# total 466 errors parameters: ignoreErrors: @@ -17,46 +17,11 @@ parameters: count: 3 path: ../../system/HTTP/IncomingRequest.php - - - message: '#^Assigning 3 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CLI/CLITest.php - - - - message: '#^Assigning array\{''ignored'', ''b'', ''c'', ''\-\-parm'', ''pvalue'', ''d'', ''\-\-p2'', ''\-\-p3'', ''value 3''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CLI/CLITest.php - - - - message: '#^Assigning array\{''ignored'', ''b'', ''c'', ''\-\-parm'', ''pvalue'', ''d''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CLI/CLITest.php - - - - message: '#^Assigning array\{''ignored'', ''b'', ''c'', ''d'', ''\-\-parm'', ''pvalue'', ''d2'', ''da\-sh'', ''\-\-fix'', ''\-\-opt\-in'', ''sure''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CLI/CLITest.php - - - - message: '#^Assigning array\{''ignored'', ''b'', ''c''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CLI/CLITest.php - - message: '#^Assigning ''http\://example\.com/'' directly on offset ''app\.baseURL'' of \$_SERVER is discouraged\.$#' count: 1 path: ../../tests/system/CLI/ConsoleTest.php - - - message: '#^Assigning int\<1, max\> directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CLI/ConsoleTest.php - - - - message: '#^Assigning non\-empty\-array\ directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CLI/ConsoleTest.php - - message: '#^Assigning ''/index\.php'' directly on offset ''SCRIPT_NAME'' of \$_SERVER is discouraged\.$#' count: 1 @@ -67,11 +32,6 @@ parameters: count: 1 path: ../../tests/system/Cache/ResponseCacheTest.php - - - message: '#^Assigning non\-empty\-list\ directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/Cache/ResponseCacheTest.php - - message: '#^Assigning non\-falsy\-string directly on offset ''REQUEST_URI'' of \$_SERVER is discouraged\.$#' count: 1 @@ -152,46 +112,6 @@ parameters: count: 1 path: ../../tests/system/CodeIgniterTest.php - - - message: '#^Assigning 1 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 5 - path: ../../tests/system/CodeIgniterTest.php - - - - message: '#^Assigning 2 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 26 - path: ../../tests/system/CodeIgniterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''/''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 11 - path: ../../tests/system/CodeIgniterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''cli''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CodeIgniterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''example''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 6 - path: ../../tests/system/CodeIgniterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''image''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/CodeIgniterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''pages/about''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 7 - path: ../../tests/system/CodeIgniterTest.php - - - - message: '#^Assigning array\{''index\.php''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 5 - path: ../../tests/system/CodeIgniterTest.php - - message: '#^Assigning non\-falsy\-string directly on offset ''REQUEST_URI'' of \$_SERVER is discouraged\.$#' count: 1 @@ -242,16 +162,6 @@ parameters: count: 38 path: ../../tests/system/Filters/FiltersTest.php - - - message: '#^Assigning 2 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/Filters/FiltersTest.php - - - - message: '#^Assigning array\{''spark'', ''list''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/Filters/FiltersTest.php - - message: '#^Assigning ''POST'' directly on offset ''REQUEST_METHOD'' of \$_SERVER is discouraged\.$#' count: 1 @@ -267,56 +177,6 @@ parameters: count: 1 path: ../../tests/system/HTTP/CLIRequestTest.php - - - message: '#^Assigning array\{''index\.php'', ''users'', ''21'', ''abc \< def'', ''McDonald\\''s'', ''\aaa\''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/HTTP/CLIRequestTest.php - - - - message: '#^Assigning array\{''index\.php'', ''users'', ''21'', ''pro\-file'', ''\-\-foo'', ''bar'', ''\-\-baz'', ''queue some stuff''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/HTTP/CLIRequestTest.php - - - - message: '#^Assigning array\{''index\.php'', ''users'', ''21'', ''profile'', ''\-\-foo'', ''bar'', ''\-\-baz'', ''queue some stuff''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/HTTP/CLIRequestTest.php - - - - message: '#^Assigning array\{''index\.php'', ''users'', ''21'', ''profile'', ''\-\-foo'', ''bar'', ''\-\-foo\-bar'', ''yes''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/HTTP/CLIRequestTest.php - - - - message: '#^Assigning array\{''index\.php'', ''users'', ''21'', ''profile'', ''\-\-foo'', ''bar''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 2 - path: ../../tests/system/HTTP/CLIRequestTest.php - - - - message: '#^Assigning array\{''index\.php'', ''users'', ''21'', ''profile'', ''\-\-foo'', ''oops'', ''bar'', ''\-\-baz'', ''queue some stuff''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/HTTP/CLIRequestTest.php - - - - message: '#^Assigning array\{''index\.php'', ''users'', ''21'', ''profile'', ''\-\-foo'', ''oops\-bar'', ''\-\-baz'', ''queue some stuff''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/HTTP/CLIRequestTest.php - - - - message: '#^Assigning array\{''index\.php'', ''users'', ''21'', ''profile'', ''\-foo'', ''bar''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/HTTP/CLIRequestTest.php - - - - message: '#^Assigning array\{''index\.php'', ''users'', ''21'', ''profile''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/HTTP/CLIRequestTest.php - - - - message: '#^Assigning array\{''spark'', ''command'', ''param1'', ''param2'', ''\-\-opt1'', ''opt1val'', ''\-\-opt\-2'', ''opt 2 val'', ''param3''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/HTTP/CLIRequestTest.php - - message: '#^Assigning ''10'' directly on offset ''HTTP_CONTENT_LENGTH'' of \$_SERVER is discouraged\.$#' count: 1 @@ -1052,46 +912,6 @@ parameters: count: 1 path: ../../tests/system/RESTful/ResourceControllerTest.php - - - message: '#^Assigning 2 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 2 - path: ../../tests/system/RESTful/ResourceControllerTest.php - - - - message: '#^Assigning 3 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 5 - path: ../../tests/system/RESTful/ResourceControllerTest.php - - - - message: '#^Assigning 4 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourceControllerTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''1'', ''edit''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourceControllerTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''1''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourceControllerTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''123''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 3 - path: ../../tests/system/RESTful/ResourceControllerTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''new''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourceControllerTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 2 - path: ../../tests/system/RESTful/ResourceControllerTest.php - - message: '#^Assigning ''/work'' directly on offset ''REQUEST_URI'' of \$_SERVER is discouraged\.$#' count: 1 @@ -1147,61 +967,6 @@ parameters: count: 3 path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - message: '#^Assigning 2 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning 3 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 4 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning 4 directly on offset ''argc'' of \$_SERVER is discouraged\.$#' - count: 3 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''create''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''delete'', ''123''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''edit'', ''1'', ''edit''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''new''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''remove'', ''123''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''show'', ''1''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work'', ''update'', ''123''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - - - message: '#^Assigning array\{''index\.php'', ''work''\} directly on offset ''argv'' of \$_SERVER is discouraged\.$#' - count: 1 - path: ../../tests/system/RESTful/ResourcePresenterTest.php - - message: '#^Assigning ''adm\.example\.com'' directly on offset ''HTTP_HOST'' of \$_SERVER is discouraged\.$#' count: 4 diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index 607eb550c6c6..03b3f826d494 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,4 +1,4 @@ -# total 3049 errors +# total 2932 errors includes: - argument.type.neon - assign.propertyType.neon