Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/Symfony/Component/HttpKernel/Bundle/AbstractBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,18 @@ public function getContainerExtension(): ?ExtensionInterface

return $this->extension ??= new BundleExtension($this, $this->extensionAlias);
}

/**
* {@inheritdoc}
*/
public function getPath(): string
{
if (null === $this->path) {
$reflected = new \ReflectionObject($this);
// assume the modern directory structure by default
$this->path = \dirname($reflected->getFileName(), 2);
}

return $this->path;
}
}
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpKernel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CHANGELOG
* Add `Profiler::isEnabled()` so collaborating collector services may elect to omit themselves
* Add the `UidValueResolver` argument value resolver
* Add `AbstractBundle` class for DI configuration/definition on a single file
* Update the path of a bundle placed in the `src/` directory to the parent directory when `AbstractBundle` is used

6.0
---
Expand Down