From 05e38eadbeb3de19e5b26003c2b401e00bb71df4 Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 18 Oct 2026 00:08:23 +0200 Subject: =?UTF-8?q?sortie=20de=20vendor=20du=20d=C3=A9p=C3=B4t,=20oubli=20?= =?UTF-8?q?dans=20config-template.ini?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Persistence/Mapping/Driver/StaticPHPDriver.php | 132 --------------------- 1 file changed, 132 deletions(-) delete mode 100644 vendor/doctrine/persistence/src/Persistence/Mapping/Driver/StaticPHPDriver.php (limited to 'vendor/doctrine/persistence/src/Persistence/Mapping/Driver/StaticPHPDriver.php') diff --git a/vendor/doctrine/persistence/src/Persistence/Mapping/Driver/StaticPHPDriver.php b/vendor/doctrine/persistence/src/Persistence/Mapping/Driver/StaticPHPDriver.php deleted file mode 100644 index bbcff75..0000000 --- a/vendor/doctrine/persistence/src/Persistence/Mapping/Driver/StaticPHPDriver.php +++ /dev/null @@ -1,132 +0,0 @@ - - */ - private $paths = []; - - /** - * Map of all class names. - * - * @var array - * @psalm-var list - */ - private $classNames; - - /** @param array|string $paths */ - public function __construct($paths) - { - $this->addPaths((array) $paths); - } - - /** - * @param array $paths - * - * @return void - */ - public function addPaths(array $paths) - { - $this->paths = array_unique(array_merge($this->paths, $paths)); - } - - /** - * {@inheritDoc} - */ - public function loadMetadataForClass(string $className, ClassMetadata $metadata) - { - $className::loadMetadata($metadata); - } - - /** - * {@inheritDoc} - * - * @todo Same code exists in ColocatedMappingDriver, should we re-use it - * somehow or not worry about it? - */ - public function getAllClassNames() - { - if ($this->classNames !== null) { - return $this->classNames; - } - - if ($this->paths === []) { - throw MappingException::pathRequiredForDriver(static::class); - } - - $classes = []; - $includedFiles = []; - - foreach ($this->paths as $path) { - if (! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); - } - - $iterator = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($path), - RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($iterator as $file) { - if ($file->getBasename('.php') === $file->getBasename()) { - continue; - } - - $sourceFile = realpath($file->getPathName()); - require_once $sourceFile; - $includedFiles[] = $sourceFile; - } - } - - $declared = get_declared_classes(); - - foreach ($declared as $className) { - $rc = new ReflectionClass($className); - - $sourceFile = $rc->getFileName(); - - if (! in_array($sourceFile, $includedFiles, true) || $this->isTransient($className)) { - continue; - } - - $classes[] = $className; - } - - $this->classNames = $classes; - - return $classes; - } - - /** - * {@inheritDoc} - */ - public function isTransient(string $className) - { - return ! method_exists($className, 'loadMetadata'); - } -} -- cgit v1.2.3