setClassMapAuthoritative example

throw new KernelPluginLoaderException($pluginName$reason);
            }

            foreach ($psr4 as $namespace => $paths) {
                if (\is_string($paths)) {
                    $paths = [$paths];
                }
                $mappedPaths = $this->mapPsrPaths($pluginName$paths$projectDir$plugin['path']);
                $this->classLoader->addPsr4($namespace$mappedPaths);
                if ($this->classLoader->isClassMapAuthoritative()) {
                    $this->classLoader->setClassMapAuthoritative(false);
                }
            }

            foreach ($psr0 as $namespace => $paths) {
                if (\is_string($paths)) {
                    $paths = [$paths];
                }
                $mappedPaths = $this->mapPsrPaths($pluginName$paths$projectDir$plugin['path']);

                $this->classLoader->add($namespace$mappedPaths);
                if ($this->classLoader->isClassMapAuthoritative()) {
                    

class KernelPluginLoaderTest extends TestCase
{
    /** * @dataProvider classLoaderDataProvider */
    public function testClassMapAuthoritativeWillBeDeactivated(bool $enabled): void
    {
        $classLoader = new ClassLoader();
        $classLoader->setClassMapAuthoritative($enabled);

        $fakeLoader = new StaticKernelPluginLoader(
            $classLoader,
            null,
            [
                [
                    'name' => 'ExampleBundle',
                    'baseClass' => ExampleBundle::class,
                    'path' => __DIR__ . '/../_fixtures/ExampleBundle',
                    'active' => true,
                    'managedByComposer' => false,
                    
Home | Imprint | This part of the site doesn't use cookies.