minor #21529 [FrameworkBundle] Simplify createPackageDefinition (dunglas)
This PR was merged into the 2.7 branch.
Discussion
----------
[FrameworkBundle] Simplify createPackageDefinition
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | n/a
Minor simplification.
Commits
-------
4b81393
[FrameworkBundle] Simplify createPackageDefinition
This commit is contained in:
commit
298060d0a0
@ -619,23 +619,14 @@ class FrameworkExtension extends Extension
|
||||
throw new \LogicException('An asset package cannot have base URLs and base paths.');
|
||||
}
|
||||
|
||||
if (!$baseUrls) {
|
||||
$package = new DefinitionDecorator('assets.path_package');
|
||||
|
||||
return $package
|
||||
->setPublic(false)
|
||||
->replaceArgument(0, $basePath)
|
||||
->replaceArgument(1, $version)
|
||||
;
|
||||
}
|
||||
|
||||
$package = new DefinitionDecorator('assets.url_package');
|
||||
|
||||
return $package
|
||||
$package = new DefinitionDecorator($baseUrls ? 'assets.url_package' : 'assets.path_package');
|
||||
$package
|
||||
->setPublic(false)
|
||||
->replaceArgument(0, $baseUrls)
|
||||
->replaceArgument(0, $baseUrls ?: $basePath)
|
||||
->replaceArgument(1, $version)
|
||||
;
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
private function createVersion(ContainerBuilder $container, $version, $format, $name)
|
||||
|
Reference in New Issue
Block a user