10000 minor #21529 [FrameworkBundle] Simplify createPackageDefinition (dung… · symfony/symfony@298060d · GitHub
[go: up one dir, main page]

Skip to content

Commit 298060d

Browse files
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
2 parents 5c07ffa + 4b81393 commit 298060d

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -619,23 +619,14 @@ private function createPackageDefinition($basePath, array $baseUrls, Reference $
619619
throw new \LogicException('An asset package cannot have base URLs and base paths.');
620620
}
621621

622-
if (!$baseUrls) {
623-
$package = new DefinitionDecorator('assets.path_package');
624-
625-
return $package
626-
->setPublic(false)
627-
->replaceArgument(0, $basePath)
628-
->replaceArgument(1, $version)
629-
;
630-
}
631-
632-
$package = new DefinitionDecorator('assets.url_package');
633-
634-
return $package
622+
$package = new DefinitionDecorator($baseUrls ? 'assets.url_package' : 'assets.path_package');
623+
$package
635624
->setPublic(false)
636-
->replaceArgument(0, $baseUrls)
625+
->replaceArgument(0, $baseUrls ?: $basePath)
637626
->replaceArgument(1, $version)
638627
;
628+
629+
return $package;
639630
}
640631

641632
private function createVersion(ContainerBuilder $container, $version, $format, $name)

0 commit comments

Comments
 (0)
0