Skip to content

Commit

Permalink
Merge branch '2.x' into 3072-timberattachmentpath-returns-incorrect-v…
Browse files Browse the repository at this point in the history
…alue
  • Loading branch information
Levdbas authored Dec 17, 2024
2 parents 6a0daf9 + 72a013e commit 097d0d1
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"require": {
"php": "^8.1",
"twig/twig": "^3.5"
"twig/twig": "^3.16"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.28",
Expand Down
81 changes: 71 additions & 10 deletions src/Twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Twig\Runtime\EscaperRuntime;
use Twig\TwigFilter;
use Twig\TwigFunction;
use Twig\DeprecatedCallableInfo;

/**
* Class Twig
Expand Down Expand Up @@ -100,7 +101,13 @@ public function get_timber_functions()
return $post_factory->from($post_id);
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: '{{ get_post() }} or {{ get_posts() }}',
altPackage: null,
altVersion: null
),
],
],
'TimberPost' => [
Expand All @@ -109,7 +116,13 @@ public function get_timber_functions()
return $post_factory->from($post_id);
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: '{{ get_post() }} or {{ get_posts() }}',
altPackage: null,
altVersion: null
),
],
],
'Image' => [
Expand All @@ -118,7 +131,13 @@ public function get_timber_functions()
return $post_factory->from($post_id);
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: '{{ get_image() }}',
altPackage: null,
altVersion: null
),
],
],
'TimberImage' => [
Expand All @@ -127,7 +146,13 @@ public function get_timber_functions()
return $post_factory->from($post_id);
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: '{{ get_image() }}',
altPackage: null,
altVersion: null
),
],
],
'Term' => [
Expand All @@ -136,7 +161,13 @@ public function get_timber_functions()
return $termFactory->from($term_id);
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: '{{ get_term() }}',
altPackage: null,
altVersion: null
),
],
],
'TimberTerm' => [
Expand All @@ -145,7 +176,13 @@ public function get_timber_functions()
return $termFactory->from($term_id);
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: '{{ get_term() }} or {{ get_terms() }}',
altPackage: null,
altVersion: null
),
],
],
'User' => [
Expand All @@ -154,7 +191,13 @@ public function get_timber_functions()
return Timber::get_user($user_id);
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: '{{ get_user() }} or {{ get_users() }}',
altPackage: null,
altVersion: null
),
],
],
'TimberUser' => [
Expand All @@ -163,7 +206,13 @@ public function get_timber_functions()
return Timber::get_user($user_id);
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: '{{ get_user() }} or {{ get_users() }}',
altPackage: null,
altVersion: null
),
],
],
'shortcode' => [
Expand Down Expand Up @@ -299,7 +348,13 @@ public function get_timber_filters()
return $obj::class;
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: "{{ function('get_class', my_object) }}",
altPackage: null,
altVersion: null
),
],
],
'print_r' => [
Expand All @@ -308,7 +363,13 @@ public function get_timber_filters()
return \print_r($arr, true);
},
'options' => [
'deprecated' => true,
'deprecation_info' => new DeprecatedCallableInfo(
package: 'timber/timber',
version: '2.0.0',
altName: '{{ dump(my_object) }}',
altPackage: null,
altVersion: null
),
],
],

Expand Down

0 comments on commit 097d0d1

Please sign in to comment.