Skip to content

Commit

Permalink
Merge pull request #15 from robisk/feature-twig_update
Browse files Browse the repository at this point in the history
twig update, code update according to break changes
  • Loading branch information
klinec authored Nov 7, 2024
2 parents 5e7debf + ec15417 commit bad73e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"require": {
"php": "^7.1|^8.0",
"symfony/framework-bundle": "^2.8.50|^3.4.26|^4.1.12|^5.3.0|^6.0",
"twig/twig": "^1.35|^2.4",
"twig/twig": "^3.11.2",
"filejet/filejet-php": "^2.7.4"
}
}
12 changes: 7 additions & 5 deletions src/Twig/FileJetExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
use FileJet\File;
use FileJet\FileInterface;
use FileJet\FileJet;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

class FileJetExtension extends \Twig_Extension
class FileJetExtension extends AbstractExtension
{
/** @var FileJet */
private $fileJet;
Expand All @@ -25,10 +27,10 @@ public function __construct(FileJet $fileJet, Config $config)
public function getFunctions()
{
return [
new \Twig_SimpleFunction('file_url', [$this, 'getUrl']),
new \Twig_SimpleFunction('asset_url', [$this, 'getAsset']),
new \Twig_SimpleFunction('external_file_url', [$this->fileJet, 'getExternalUrl']),
new \Twig_SimpleFunction('private_file_url', [$this->fileJet, 'getPrivateUrl'])
new TwigFunction('file_url', [$this, 'getUrl']),
new TwigFunction('asset_url', [$this, 'getAsset']),
new TwigFunction('external_file_url', [$this->fileJet, 'getExternalUrl']),
new TwigFunction('private_file_url', [$this->fileJet, 'getPrivateUrl'])
];
}

Expand Down

0 comments on commit bad73e5

Please sign in to comment.