Skip to content

Commit

Permalink
Override Bundle::getPath()
Browse files Browse the repository at this point in the history
This is required when the bundle class is not at the root path of the
bundle, which is the case since #1767
  • Loading branch information
greg0ire committed Mar 15, 2024
1 parent fa3e8e3 commit 870021f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/DoctrineBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Proxy\Autoloader;
use Doctrine\ORM\Proxy\DefaultProxyClassNameResolver;
use ReflectionObject;

Check failure on line 19 in src/DoctrineBundle.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (8.2)

Type ReflectionObject is not used in this file.
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\DoctrineValidationPass;
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass;
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterUidTypePass;
Expand All @@ -30,6 +31,7 @@
use function assert;
use function class_exists;
use function clearstatcache;
use function dirname;
use function spl_autoload_unregister;

/** @final since 2.9 */
Expand Down Expand Up @@ -168,4 +170,14 @@ public function shutdown()
public function registerCommands(Application $application)
{
}

public function getPath(): string
{
/** @psalm-suppress RedundantPropertyInitializationCheck */
if (! isset($this->path)) {
$this->path = dirname(__DIR__);
}

return $this->path;
}
}

0 comments on commit 870021f

Please sign in to comment.