Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions code_samples/back_office/images/src/SvgExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
namespace App\Twig;

use Symfony\Component\Routing\RouterInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
use Twig\Attribute\AsTwigFunction;

class SvgExtension extends AbstractExtension
class SvgExtension
{
/**
* SvgExtension constructor.
Expand All @@ -17,17 +16,7 @@ public function __construct(protected RouterInterface $router)
{
}

/**
* @return \Twig\TwigFunction[]
*/
#[\Override]
public function getFunctions(): array
{
return [
new TwigFunction('ibexa_svg_link', $this->generateLink(...)),
];
}

#[AsTwigFunction(name: 'ibexa_svg_link')]
public function generateLink(int $contentId, string $fieldIdentifier, string $filename): string
{
return $this->router->generate('app.svg_download', [
Expand Down
3 changes: 0 additions & 3 deletions docs/update_and_migration/from_4.6/update_to_5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ As this update spans across a broad range of versions, multiple rules can be con
//…
use Ibexa\Contracts\Rector\Sets\IbexaSetList;
use Rector\Config\RectorConfig;
use Rector\Symfony\Set\SensiolabsSetList;
use Rector\Symfony\Set\SymfonySetList;

return RectorConfig::configure()
Expand All @@ -489,7 +488,6 @@ return RectorConfig::configure()
SymfonySetList::SYMFONY_72, // https://getrector.com/find-rule?activeRectorSetGroup=symfony&rectorSet=symfony-symfonysymfony-72
SymfonySetList::SYMFONY_73, // https://getrector.com/find-rule?activeRectorSetGroup=symfony&rectorSet=symfony-symfonysymfony-73
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
SensiolabsSetList::ANNOTATIONS_TO_ATTRIBUTES,
]
)
->withPhpSets()
Expand All @@ -504,7 +502,6 @@ return RectorConfig::configure()
naming: true, // https://getrector.com/find-rule?activeRectorSetGroup=core&rectorSet=core-naming
instanceOf: true, // https://getrector.com/find-rule?activeRectorSetGroup=core&rectorSet=core-instanceof
earlyReturn: true, // https://getrector.com/find-rule?activeRectorSetGroup=core&rectorSet=core-early-return
strictBooleans: true, // https://getrector.com/find-rule?activeRectorSetGroup=core&rectorSet=core-strict-booleans
rectorPreset: true,
symfonyCodeQuality: true, // https://getrector.com/find-rule?activeRectorSetGroup=symfony&rectorSet=symfony-code-quality
symfonyConfigs: true, // https://getrector.com/find-rule?activeRectorSetGroup=symfony&rectorSet=symfony-configs
Expand Down
2 changes: 2 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@
SymfonySetList::SYMFONY_70,
SymfonySetList::SYMFONY_71,
SymfonySetList::SYMFONY_72,
SymfonySetList::SYMFONY_73,
SymfonySetList::SYMFONY_74,
Comment on lines +28 to +29

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

]);
Loading