{"record":{"id":"59ceaa8f2b62bc60","repo":"composer/composer","slug":"diagnosecommand-unknown-warning-type-s-please","errorCode":null,"errorMessage":"DiagnoseCommand: Unknown warning type \"%s\". Please report at https://github.com/composer/composer/issues/new.","messagePattern":"DiagnoseCommand: Unknown warning type \"(.+?)\"\\. Please report at https://github\\.com/composer/composer/issues/new\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Composer/Command/DiagnoseCommand.php","lineNumber":909,"sourceCode":"                    case 'xdebug_profile':\n                        $text = \"The xdebug.profiler_enabled setting is enabled, this can slow down Composer a lot.\".PHP_EOL;\n                        $text .= \"Add the following to the end of your `php.ini` to disable it:\".PHP_EOL;\n                        $text .= \"  xdebug.profiler_enabled = 0\";\n                        $displayIniMessage = true;\n                        break;\n\n                    case 'onedrive':\n                        $text = \"The Windows OneDrive folder is not supported on PHP versions below 7.2.23 and 7.3.10.\".PHP_EOL;\n                        $text .= \"Upgrade your PHP ({$current}) to use this location with Composer.\".PHP_EOL;\n                        break;\n\n                    case 'uopz':\n                        $text = \"The uopz extension ignores exit calls and may not work with all Composer commands.\".PHP_EOL;\n                        $text .= \"Disabling it when using Composer is recommended.\";\n                        break;\n\n                    default:\n                        throw new \\InvalidArgumentException(sprintf(\"DiagnoseCommand: Unknown warning type \\\"%s\\\". Please report at https://github.com/composer/composer/issues/new.\", $warning));\n                }\n                $out($text, 'comment');\n            }\n        }\n\n        if ($displayIniMessage) {\n            $out($iniMessage, 'comment');\n        }\n\n        if (in_array(Platform::getEnv('COMPOSER_IPRESOLVE'), ['4', '6'], true)) {\n            $warnings['ipresolve'] = true;\n            $out('The COMPOSER_IPRESOLVE env var is set to ' . Platform::getEnv('COMPOSER_IPRESOLVE') .' which may result in network failures below.', 'comment');\n        }\n\n        return count($warnings) === 0 && count($errors) === 0 ? true : $output;\n    }\n\n    /**","sourceCodeStart":891,"sourceCodeEnd":927,"githubUrl":"https://github.com/composer/composer/blob/6ffc1177404d0c50119c22dde6564a380f4a82c9/src/Composer/Command/DiagnoseCommand.php#L891-L927","documentation":"Symmetric to the unknown-error-type guard: thrown inside the warnings loop of DiagnoseCommand when a warning key is not recognized by its switch. It exists so that no warning silently passes without explanation, forcing a bug report for unhandled categories.","triggerScenarios":"Running `composer diagnose` and hitting a warning classification key not present in the switch (apc_cli, zlib, sigchild, curlwrappers, openssl_version, xdebug_loaded, xdebug_profile, onedrive, uopz). Reachable mainly via a Composer regression or an unrecognized PHP environment.","commonSituations":"Extremely rare; would point to a Composer build that is out of sync with the PHP environment it is diagnosing, or a custom/patched Composer.","solutions":["Upgrade Composer: `composer self-update`.","Re-run `composer diagnose`.","Report the issue at the Composer GitHub tracker with full output if it persists."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    $app->run(); // composer diagnose\n} catch (\\InvalidArgumentException $e) {\n    if (str_contains($e->getMessage(), 'DiagnoseCommand: Unknown warning type')) {\n        // Upgrade composer; re-run diagnose; report if unresolved.\n    }\n}","preventionTips":["Run the latest Composer release.","When adding new warning categories in forks, extend the switch in DiagnoseCommand.","Report genuine occurrences upstream with full diagnose output."],"tags":["diagnose","internal","cli","bug-report"],"analyzedSha":"6ffc1177404d0c50119c22dde6564a380f4a82c9","analyzedAt":"2026-08-07T00:01:08.491Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}