~xaav/tsep/symfony

« back to all changes in this revision

Viewing changes to src/Symfony/Bridge/Twig/Extension/AssetExtension.php

  • Committer: Fabien Potencier
  • Date: 2015-05-21 07:31:29 UTC
  • mfrom: (7647.2.1)
  • Revision ID: git-v1:b248bd1ee1d17ba892fa4742ccfc75fcacd8a9fb
bug #14708 [TwigBridge] use proper class to fetch asset version strategy property (xabbuh)

This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBridge] use proper class to fetch asset version strategy property

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

Commits
-------

01b7dd6 [TwigBridge] use proper class to fetch asset version strategy property

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    {
99
99
        if ($version) {
100
100
            $package = $this->packages->getPackage($packageName);
101
 
 
102
 
            $v = new \ReflectionProperty($package, 'versionStrategy');
 
101
            $class = new \ReflectionClass($package);
 
102
 
 
103
            while ('Symfony\Component\Asset\Package' !== $class->getName()) {
 
104
                $class = $class->getParentClass();
 
105
            }
 
106
 
 
107
            $v = $class->getProperty('versionStrategy');
103
108
            $v->setAccessible(true);
104
 
 
105
109
            $currentVersionStrategy = $v->getValue($package);
106
110
 
107
111
            $f = new \ReflectionProperty($currentVersionStrategy, 'format');