minor #30943 [Asset] PathPackage : use parent getUrl Method instead of duplicating code (tiecoders)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Asset] PathPackage : use parent getUrl Method instead of duplicating code

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Use parent getUrl method instead of duplicating code.

Commits
-------

0c2a2bf536 ASSET-PathPackage-Enhancement  - Use parent getUrl method instead of duplicating code.
This commit is contained in:
Fabien Potencier 2019-04-07 11:43:31 +02:00
commit ca290396fb
1 changed files with 1 additions and 5 deletions

View File

@ -53,11 +53,7 @@ class PathPackage extends Package
*/
public function getUrl($path)
{
if ($this->isAbsoluteUrl($path)) {
return $path;
}
$versionedPath = $this->getVersionStrategy()->applyVersion($path);
$versionedPath = parent::getUrl($path);
// if absolute or begins with /, we're done
if ($this->isAbsoluteUrl($versionedPath) || ($versionedPath && '/' === $versionedPath[0])) {