The type BackedEnum was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. excluded_paths:["lib/*"],
you can move it to the dependency path list as follows:
The doc comment array<class-string<BackedEnum>, PhpEnumType> at position 2 could not be parsed: Unknown type name 'class-string' at position 2 in array<class-string<BackedEnum>, PhpEnumType>.
Loading history...
21
*/
22
private array $cache = [];
23
24
public function canCreate(ContainerInterface $container, $requestedName)
25
{
26
$class = $this->getClass($requestedName);
27
28
return (bool) $class;
29
}
30
31
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
32
{
33
$class = $this->getClass($requestedName);
34
if (!$class) {
35
throw new Exception('Cannot create a PhpEnumType for a name not matching a backed enum: ' . $requestedName);
36
}
37
38
// Share the same instance between short name and FQCN
The doc comment null|class-string<BackedEnum> at position 2 could not be parsed: Unknown type name 'class-string' at position 2 in null|class-string<BackedEnum>.
Loading history...
48
*/
49
private function getClass(string $requestedName): ?string
50
{
51
$possibilities = [
52
$requestedName,
53
'Application\Enum\\' . $requestedName,
54
];
55
56
foreach ($possibilities as $class) {
57
if (class_exists($class) && is_a($class, BackedEnum::class, true)) {
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths