~xaav/tsep/symfony

« back to all changes in this revision

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

  • Committer: Christian Flothmann
  • Date: 2015-05-21 06:14:41 UTC
  • mto: This revision was merged to the branch mainline in revision 7650.
  • Revision ID: git-v1:01b7dd6d9f1d6e6e0f57ca99aa4e6c2e74b05e11
[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');