Skip to content

Commit

Permalink
deprecate twig filters and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Nov 9, 2023
1 parent b375f83 commit f091958
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/Twig/ArrayExtension.php
Expand Up @@ -26,7 +26,7 @@ class ArrayExtension extends AbstractExtension implements ContainerAwareInterfac
public function getFilters()
{
return [
new TwigFilter('deserialize', [$this, 'deserialize']),
new TwigFilter('deserialize', [$this, 'deserialize'], ['deprecated' => true]),
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Twig/DateExtension.php
Expand Up @@ -23,7 +23,7 @@ class DateExtension extends AbstractExtension
public function getFilters()
{
return [
new TwigFilter('localized_date', [$this, 'getLocalizedDate']),
new TwigFilter('localized_date', [$this, 'getLocalizedDate'], ['deprecated' => true]),
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Twig/DcaExtension.php
Expand Up @@ -20,7 +20,7 @@ class DcaExtension extends AbstractExtension implements ContainerAwareInterface
public function getFilters()
{
return [
new TwigFilter('fieldLabel', [$this, 'fieldLabel']),
new TwigFilter('fieldLabel', [$this, 'fieldLabel'], ['deprecated' => true]),
];
}

Expand Down
10 changes: 5 additions & 5 deletions src/Twig/DownloadExtension.php
Expand Up @@ -55,11 +55,11 @@ public function __construct(RequestStack $requestStack, Utils $utils, \Twig\Envi
public function getFilters()
{
return [
new TwigFilter('download', [$this, 'getDownload']),
new TwigFilter('download_link', [$this, 'getDownloadLink']),
new TwigFilter('download_path', [$this, 'getDownloadPath']),
new TwigFilter('download_data', [$this, 'getDownloadData']),
new TwigFilter('download_title', [$this, 'getDownloadTitle']),
new TwigFilter('download', [$this, 'getDownload', ['deprecated' => true]]),
new TwigFilter('download_link', [$this, 'getDownloadLink'], ['deprecated' => true]),
new TwigFilter('download_path', [$this, 'getDownloadPath'], ['deprecated' => true]),
new TwigFilter('download_data', [$this, 'getDownloadData'], ['deprecated' => true]),
new TwigFilter('download_title', [$this, 'getDownloadTitle'], ['deprecated' => true]),
];
}

Expand Down
8 changes: 4 additions & 4 deletions src/Twig/FileExtension.php
Expand Up @@ -62,10 +62,10 @@ class FileExtension extends AbstractExtension implements ContainerAwareInterface
public function getFilters()
{
return [
new TwigFilter('file_data', [$this, 'getFileData']),
new TwigFilter('file_path', [$this, 'getFilePath']),
new TwigFilter('file_content', [$this, 'getFileContent']),
new TwigFilter('bin2uuid', [$this, 'convertBinaryToUuid']),
new TwigFilter('file_data', [$this, 'getFileData'], ['deprecated' => true]),
new TwigFilter('file_path', [$this, 'getFilePath'], ['deprecated' => true]),
new TwigFilter('file_content', [$this, 'getFileContent'], ['deprecated' => true]),
new TwigFilter('bin2uuid', [$this, 'convertBinaryToUuid'], ['deprecated' => true]),
];
}

Expand Down
12 changes: 6 additions & 6 deletions src/Twig/ImageExtension.php
Expand Up @@ -30,12 +30,12 @@ class ImageExtension extends AbstractExtension implements ContainerAwareInterfac
public function getFilters()
{
return [
new TwigFilter('image', [$this, 'getImage']),
new TwigFilter('image_caption', [$this, 'getImageCaption']),
new TwigFilter('image_width', [$this, 'getImageWidth']),
new TwigFilter('image_data', [$this, 'getImageData']),
new TwigFilter('image_gallery', [$this, 'getImageGallery']),
new TwigFilter('image_size', [$this, 'getImageSize']),
new TwigFilter('image', [$this, 'getImage'], ['deprecated' => true]),
new TwigFilter('image_caption', [$this, 'getImageCaption'], ['deprecated' => true]),
new TwigFilter('image_width', [$this, 'getImageWidth'], ['deprecated' => true]),
new TwigFilter('image_data', [$this, 'getImageData'], ['deprecated' => true]),
new TwigFilter('image_gallery', [$this, 'getImageGallery'], ['deprecated' => true]),
new TwigFilter('image_size', [$this, 'getImageSize'], ['deprecated' => true]),
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Twig/StringExtension.php
Expand Up @@ -39,9 +39,9 @@ public function __construct(AnonymizerUtil $anonymizerUtil, ContaoFrameworkInter
public function getFilters()
{
return [
new TwigFilter('autolink', [$this, 'autolink']),
new TwigFilter('autolink', [$this, 'autolink'], ['deprecated' => true]),
new TwigFilter('anonymize_email', [$this, 'anonymizeEmail']),
new TwigFilter('replace_inserttag', [$this, 'replaceInsertTag']),
new TwigFilter('replace_inserttag', [$this, 'replaceInsertTag'], ['deprecated' => true]),
];
}

Expand Down
24 changes: 12 additions & 12 deletions src/Twig/TestExtension.php
Expand Up @@ -24,18 +24,18 @@ class TestExtension extends AbstractExtension implements ContainerAwareInterface
public function getTests()
{
return [
new TwigTest('numeric', [$this, 'isNumeric']),
new TwigTest('float', [$this, 'isFloat']),
new TwigTest('string', [$this, 'isString']),
new TwigTest('object', [$this, 'isObject']),
new TwigTest('array', [$this, 'isArray']),
new TwigTest('bool', [$this, 'isBool']),
new TwigTest('int', [$this, 'isInt']),
new TwigTest('uuid', [$this, 'isUuid']),
new TwigTest('binaryUuid', [$this, 'isBinaryUuid']),
new TwigTest('stringUuid', [$this, 'isStringUuid']),
new TwigTest('url', [$this, 'isUrl']),
new TwigTest('email', [$this, 'isEmail']),
new TwigTest('numeric', [$this, 'isNumeric'], ['deprecated' => true]),
new TwigTest('float', [$this, 'isFloat'], ['deprecated' => true]),
new TwigTest('string', [$this, 'isString'], ['deprecated' => true]),
new TwigTest('object', [$this, 'isObject'], ['deprecated' => true]),
new TwigTest('array', [$this, 'isArray'], ['deprecated' => true]),
new TwigTest('bool', [$this, 'isBool'], ['deprecated' => true]),
new TwigTest('int', [$this, 'isInt'], ['deprecated' => true]),
new TwigTest('uuid', [$this, 'isUuid'], ['deprecated' => true]),
new TwigTest('binaryUuid', [$this, 'isBinaryUuid'], ['deprecated' => true]),
new TwigTest('stringUuid', [$this, 'isStringUuid'], ['deprecated' => true]),
new TwigTest('url', [$this, 'isUrl'], ['deprecated' => true]),
new TwigTest('email', [$this, 'isEmail'], ['deprecated' => true]),
];
}

Expand Down

0 comments on commit f091958

Please sign in to comment.