Failed Conditions
Pull Request — 2.7 (#6990)
by Grégoire
116:45 queued 64:39
created

deprecating_autoloader.php (1 issue)

Labels
Severity
1
<?php
2
3
use Doctrine\ORM\Mapping\ClassMetadata;
4
use Doctrine\ORM\Mapping\ClassMetadataInfo;
0 ignored issues
show
The type Doctrine\ORM\Mapping\ClassMetadataInfo 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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
6
spl_autoload_register(function ($class) : void {
7
    $deprecatedClasses = [
8
        ClassMetadataInfo::class => [ClassMetadata::class, '2.7', '3.0'],
9
    ];
10
11
    if (array_key_exists($class, $deprecatedClasses)) {
12
        $deprecationMetadata = $deprecatedClasses[$class];
13
        @trigger_error(sprintf(
14
            'Class %s is deprecated in favor of class %s since %s, will be removed in %s.',
15
            $class,
16
            ...$deprecationMetadata
17
        ), E_USER_DEPRECATED);
18
        class_alias($deprecationMetadata[0], $class);
19
    }
20
});
21