Skip to content

Commit 20f0d60

Browse files
committed
minor symfony#17450 [FrameworkBundle] Fix upgrade guides concerning erroneous removal of assets helper (regularjack)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] Fix upgrade guides concerning erroneous removal of assets helper | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As mentioned in symfony#17041, the upgrade guides for 2.7 and 3.0 erroneously mention that the `templating.helper.assets` service is removed in 3.0. symfony#17041 cannot fix these issues since it targets 3.0. This PR should only be merged after symfony#17041 since it depends on it. Commits ------- 5abac56 Fix upgrade guides concerning erroneous removal of assets helper
2 parents 90ce9bc + 5abac56 commit 20f0d60

File tree

2 files changed

+2
-47
lines changed

2 files changed

+2
-47
lines changed

UPGRADE-2.7.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,11 +596,11 @@ TwigBundle
596596
FrameworkBundle
597597
---------------
598598

599-
* The `templating.helper.assets` was refactored and returns now an object of the type
599+
* The `templating.helper.assets` service was refactored and now returns an object of type
600600
`Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper` instead of
601601
`Symfony\Component\Templating\Helper\CoreAssetsHelper`. You can update your class definition
602602
or use the `assets.packages` service instead. Using the `assets.packages` service is the recommended
603-
way. The `templating.helper.assets` service will be removed in Symfony 3.0.
603+
way.
604604

605605
Before:
606606

UPGRADE-3.0.md

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -388,51 +388,6 @@ UPGRADE FROM 2.x to 3.0
388388
* The `request` service was removed. You must inject the `request_stack`
389389
service instead.
390390

391-
* The `templating.helper.assets` was removed in Symfony 3.0. You should
392-
use the `assets.package` service instead.
393-
394-
Before:
395-
396-
```php
397-
use Symfony\Component\Templating\Helper\CoreAssetsHelper;
398-
399-
class DemoService
400-
{
401-
private $assetsHelper;
402-
403-
public function __construct(CoreAssetsHelper $assetsHelper)
404-
{
405-
$this->assetsHelper = $assetsHelper;
406-
}
407-
408-
public function testMethod()
409-
{
410-
return $this->assetsHelper->getUrl('thumbnail.png', null, $this->assetsHelper->getVersion());
411-
}
412-
}
413-
```
414-
415-
After:
416-
417-
```php
418-
use Symfony\Component\Asset\Packages;
419-
420-
class DemoService
421-
{
422-
private $assetPackages;
423-
424-
public function __construct(Packages $assetPackages)
425-
{
426-
$this->assetPackages = $assetPackages;
427-
}
428-
429-
public function testMethod()
430-
{
431-
return $this->assetPackages->getUrl('thumbnail.png').$this->assetPackages->getVersion();
432-
}
433-
}
434-
```
435-
436391
* The `enctype` method of the `form` helper was removed. You should use the
437392
new method `start` instead.
438393

0 commit comments

Comments
 (0)