{"record":{"id":"403d2a0349e00f70","repo":"nikic/PHP-Parser","slug":"s-type-cannot-be-nullable","errorCode":null,"errorMessage":"%s type cannot be nullable","messagePattern":"(.+?) type cannot be nullable","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/BuilderHelpers.php","lineNumber":208,"sourceCode":"            'null',\n            'false',\n            'mixed',\n            'never',\n            'true',\n        ];\n\n        $lowerType = strtolower($type);\n        if (in_array($lowerType, $builtinTypes)) {\n            $type = new Identifier($lowerType);\n        } else {\n            $type = self::normalizeName($type);\n        }\n\n        $notNullableTypes = [\n            'void', 'mixed', 'never',\n        ];\n        if ($nullable && in_array((string) $type, $notNullableTypes)) {\n            throw new \\LogicException(sprintf('%s type cannot be nullable', $type));\n        }\n\n        return $nullable ? new NullableType($type) : $type;\n    }\n\n    /**\n     * Normalizes a value: Converts nulls, booleans, integers,\n     * floats, strings and arrays into their respective nodes\n     *\n     * @param Node\\Expr|bool|null|int|float|string|array|\\UnitEnum $value The value to normalize\n     *\n     * @return Expr The normalized value\n     */\n    public static function normalizeValue($value): Expr {\n        if ($value instanceof Node\\Expr) {\n            return $value;\n        }\n","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/BuilderHelpers.php#L190-L226","documentation":"Error \"%s type cannot be nullable\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/BuilderHelpers.php:208 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fbd47f7ebcbb450138d92642a0a53b72a5285dda","analyzedAt":"2026-08-17T03:58:32.123Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}