vendor/twig/twig/src/Resources/core.php line 382

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Twig.
  4.  *
  5.  * (c) Fabien Potencier
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. use Twig\Environment;
  11. use Twig\Extension\CoreExtension;
  12. /**
  13.  * @internal
  14.  *
  15.  * @deprecated since Twig 3.9
  16.  */
  17. function twig_cycle($values$position)
  18. {
  19.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  20.     return CoreExtension::cycle($values$position);
  21. }
  22. /**
  23.  * @internal
  24.  *
  25.  * @deprecated since Twig 3.9
  26.  */
  27. function twig_random(Environment $env$values null$max null)
  28. {
  29.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  30.     return CoreExtension::random($env->getCharset(), $values$max);
  31. }
  32. /**
  33.  * @internal
  34.  *
  35.  * @deprecated since Twig 3.9
  36.  */
  37. function twig_date_format_filter(Environment $env$date$format null$timezone null)
  38. {
  39.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  40.     return $env->getExtension(CoreExtension::class)->formatDate($date$format$timezone);
  41. }
  42. /**
  43.  * @internal
  44.  *
  45.  * @deprecated since Twig 3.9
  46.  */
  47. function twig_date_modify_filter(Environment $env$date$modifier)
  48. {
  49.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  50.     return $env->getExtension(CoreExtension::class)->modifyDate($date$modifier);
  51. }
  52. /**
  53.  * @internal
  54.  *
  55.  * @deprecated since Twig 3.9
  56.  */
  57. function twig_sprintf($format, ...$values)
  58. {
  59.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  60.     return CoreExtension::sprintf($format, ...$values);
  61. }
  62. /**
  63.  * @internal
  64.  *
  65.  * @deprecated since Twig 3.9
  66.  */
  67. function twig_date_converter(Environment $env$date null$timezone null)
  68. {
  69.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  70.     return $env->getExtension(CoreExtension::class)->convertDate($date$timezone);
  71. }
  72. /**
  73.  * @internal
  74.  *
  75.  * @deprecated since Twig 3.9
  76.  */
  77. function twig_replace_filter($str$from)
  78. {
  79.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  80.     return CoreExtension::replace($str$from);
  81. }
  82. /**
  83.  * @internal
  84.  *
  85.  * @deprecated since Twig 3.9
  86.  */
  87. function twig_round($value$precision 0$method 'common')
  88. {
  89.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  90.     return CoreExtension::round($value$precision$method);
  91. }
  92. /**
  93.  * @internal
  94.  *
  95.  * @deprecated since Twig 3.9
  96.  */
  97. function twig_number_format_filter(Environment $env$number$decimal null$decimalPoint null$thousandSep null)
  98. {
  99.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  100.     return $env->getExtension(CoreExtension::class)->formatNumber($number$decimal$decimalPoint$thousandSep);
  101. }
  102. /**
  103.  * @internal
  104.  *
  105.  * @deprecated since Twig 3.9
  106.  */
  107. function twig_urlencode_filter($url)
  108. {
  109.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  110.     return CoreExtension::urlencode($url);
  111. }
  112. /**
  113.  * @internal
  114.  *
  115.  * @deprecated since Twig 3.9
  116.  */
  117. function twig_array_merge(...$arrays)
  118. {
  119.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  120.     return CoreExtension::merge(...$arrays);
  121. }
  122. /**
  123.  * @internal
  124.  *
  125.  * @deprecated since Twig 3.9
  126.  */
  127. function twig_slice(Environment $env$item$start$length null$preserveKeys false)
  128. {
  129.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  130.     return CoreExtension::slice($env->getCharset(), $item$start$length$preserveKeys);
  131. }
  132. /**
  133.  * @internal
  134.  *
  135.  * @deprecated since Twig 3.9
  136.  */
  137. function twig_first(Environment $env$item)
  138. {
  139.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  140.     return CoreExtension::first($env->getCharset(), $item);
  141. }
  142. /**
  143.  * @internal
  144.  *
  145.  * @deprecated since Twig 3.9
  146.  */
  147. function twig_last(Environment $env$item)
  148. {
  149.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  150.     return CoreExtension::last($env->getCharset(), $item);
  151. }
  152. /**
  153.  * @internal
  154.  *
  155.  * @deprecated since Twig 3.9
  156.  */
  157. function twig_join_filter($value$glue ''$and null)
  158. {
  159.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  160.     return CoreExtension::join($value$glue$and);
  161. }
  162. /**
  163.  * @internal
  164.  *
  165.  * @deprecated since Twig 3.9
  166.  */
  167. function twig_split_filter(Environment $env$value$delimiter$limit null)
  168. {
  169.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  170.     return CoreExtension::split($env->getCharset(), $value$delimiter$limit);
  171. }
  172. /**
  173.  * @internal
  174.  *
  175.  * @deprecated since Twig 3.9
  176.  */
  177. function twig_get_array_keys_filter($array)
  178. {
  179.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  180.     return CoreExtension::keys($array);
  181. }
  182. /**
  183.  * @internal
  184.  *
  185.  * @deprecated since Twig 3.9
  186.  */
  187. function twig_reverse_filter(Environment $env$item$preserveKeys false)
  188. {
  189.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  190.     return CoreExtension::reverse($env->getCharset(), $item$preserveKeys);
  191. }
  192. /**
  193.  * @internal
  194.  *
  195.  * @deprecated since Twig 3.9
  196.  */
  197. function twig_sort_filter(Environment $env$array$arrow null)
  198. {
  199.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  200.     return CoreExtension::sort($env$array$arrow);
  201. }
  202. /**
  203.  * @internal
  204.  *
  205.  * @deprecated since Twig 3.9
  206.  */
  207. function twig_matches(string $regexp, ?string $str)
  208. {
  209.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  210.     return CoreExtension::matches($regexp$str);
  211. }
  212. /**
  213.  * @internal
  214.  *
  215.  * @deprecated since Twig 3.9
  216.  */
  217. function twig_trim_filter($string$characterMask null$side 'both')
  218. {
  219.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  220.     return CoreExtension::trim($string$characterMask$side);
  221. }
  222. /**
  223.  * @internal
  224.  *
  225.  * @deprecated since Twig 3.9
  226.  */
  227. function twig_nl2br($string)
  228. {
  229.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  230.     return CoreExtension::nl2br($string);
  231. }
  232. /**
  233.  * @internal
  234.  *
  235.  * @deprecated since Twig 3.9
  236.  */
  237. function twig_spaceless($content)
  238. {
  239.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  240.     return CoreExtension::spaceless($content);
  241. }
  242. /**
  243.  * @internal
  244.  *
  245.  * @deprecated since Twig 3.9
  246.  */
  247. function twig_convert_encoding($string$to$from)
  248. {
  249.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  250.     return CoreExtension::convertEncoding($string$to$from);
  251. }
  252. /**
  253.  * @internal
  254.  *
  255.  * @deprecated since Twig 3.9
  256.  */
  257. function twig_length_filter(Environment $env$thing)
  258. {
  259.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  260.     return CoreExtension::length($env->getCharset(), $thing);
  261. }
  262. /**
  263.  * @internal
  264.  *
  265.  * @deprecated since Twig 3.9
  266.  */
  267. function twig_upper_filter(Environment $env$string)
  268. {
  269.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  270.     return CoreExtension::upper($env->getCharset(), $string);
  271. }
  272. /**
  273.  * @internal
  274.  *
  275.  * @deprecated since Twig 3.9
  276.  */
  277. function twig_lower_filter(Environment $env$string)
  278. {
  279.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  280.     return CoreExtension::lower($env->getCharset(), $string);
  281. }
  282. /**
  283.  * @internal
  284.  *
  285.  * @deprecated since Twig 3.9
  286.  */
  287. function twig_striptags($string$allowable_tags null)
  288. {
  289.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  290.     return CoreExtension::striptags($string$allowable_tags);
  291. }
  292. /**
  293.  * @internal
  294.  *
  295.  * @deprecated since Twig 3.9
  296.  */
  297. function twig_title_string_filter(Environment $env$string)
  298. {
  299.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  300.     return CoreExtension::titleCase($env->getCharset(), $string);
  301. }
  302. /**
  303.  * @internal
  304.  *
  305.  * @deprecated since Twig 3.9
  306.  */
  307. function twig_capitalize_string_filter(Environment $env$string)
  308. {
  309.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  310.     return CoreExtension::capitalize($env->getCharset(), $string);
  311. }
  312. /**
  313.  * @internal
  314.  *
  315.  * @deprecated since Twig 3.9
  316.  */
  317. function twig_test_empty($value)
  318. {
  319.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  320.     return CoreExtension::testEmpty($value);
  321. }
  322. /**
  323.  * @internal
  324.  *
  325.  * @deprecated since Twig 3.9
  326.  */
  327. function twig_test_iterable($value)
  328. {
  329.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  330.     return is_iterable($value);
  331. }
  332. /**
  333.  * @internal
  334.  *
  335.  * @deprecated since Twig 3.9
  336.  */
  337. function twig_include(Environment $env$context$template$variables = [], $withContext true$ignoreMissing false$sandboxed false)
  338. {
  339.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  340.     return CoreExtension::include($env$context$template$variables$withContext$ignoreMissing$sandboxed);
  341. }
  342. /**
  343.  * @internal
  344.  *
  345.  * @deprecated since Twig 3.9
  346.  */
  347. function twig_source(Environment $env$name$ignoreMissing false)
  348. {
  349.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  350.     return CoreExtension::source($env$name$ignoreMissing);
  351. }
  352. /**
  353.  * @internal
  354.  *
  355.  * @deprecated since Twig 3.9
  356.  */
  357. function twig_constant($constant$object null)
  358. {
  359.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  360.     return CoreExtension::constant($constant$object);
  361. }
  362. /**
  363.  * @internal
  364.  *
  365.  * @deprecated since Twig 3.9
  366.  */
  367. function twig_constant_is_defined($constant$object null)
  368. {
  369.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  370.     return CoreExtension::constantIsDefined($constant$object);
  371. }
  372. /**
  373.  * @internal
  374.  *
  375.  * @deprecated since Twig 3.9
  376.  */
  377. function twig_array_batch($items$size$fill null$preserveKeys true)
  378. {
  379.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  380.     return CoreExtension::batch($items$size$fill$preserveKeys);
  381. }
  382. /**
  383.  * @internal
  384.  *
  385.  * @deprecated since Twig 3.9
  386.  */
  387. function twig_array_column($array$name$index null): array
  388. {
  389.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  390.     return CoreExtension::column($array$name$index);
  391. }
  392. /**
  393.  * @internal
  394.  *
  395.  * @deprecated since Twig 3.9
  396.  */
  397. function twig_array_filter(Environment $env$array$arrow)
  398. {
  399.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  400.     return CoreExtension::filter($env$array$arrow);
  401. }
  402. /**
  403.  * @internal
  404.  *
  405.  * @deprecated since Twig 3.9
  406.  */
  407. function twig_array_map(Environment $env$array$arrow)
  408. {
  409.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  410.     return CoreExtension::map($env$array$arrow);
  411. }
  412. /**
  413.  * @internal
  414.  *
  415.  * @deprecated since Twig 3.9
  416.  */
  417. function twig_array_reduce(Environment $env$array$arrow$initial null)
  418. {
  419.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  420.     return CoreExtension::reduce($env$array$arrow$initial);
  421. }
  422. /**
  423.  * @internal
  424.  *
  425.  * @deprecated since Twig 3.9
  426.  */
  427. function twig_array_some(Environment $env$array$arrow)
  428. {
  429.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  430.     return CoreExtension::arraySome($env$array$arrow);
  431. }
  432. /**
  433.  * @internal
  434.  *
  435.  * @deprecated since Twig 3.9
  436.  */
  437. function twig_array_every(Environment $env$array$arrow)
  438. {
  439.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  440.     return CoreExtension::arrayEvery($env$array$arrow);
  441. }
  442. /**
  443.  * @internal
  444.  *
  445.  * @deprecated since Twig 3.9
  446.  */
  447. function twig_check_arrow_in_sandbox(Environment $env$arrow$thing$type)
  448. {
  449.     trigger_deprecation('twig/twig''3.9''Using the internal "%s" function is deprecated.'__FUNCTION__);
  450.     return CoreExtension::checkArrowInSandbox($env$arrow$thing$type);
  451. }