1 | <?php |
||
15 | class DataToTwigConvertor |
||
16 | { |
||
17 | /** @var callable */ |
||
18 | private $convertor; |
||
19 | |||
20 | protected function __construct(callable $convertor) |
||
24 | |||
25 | /** |
||
26 | * Data will not be written to the twig template |
||
27 | * |
||
28 | * @return static |
||
29 | */ |
||
30 | public static function nothing(): self |
||
36 | |||
37 | /** |
||
38 | * @param bool $force Define the value of the variable even if it is passed to the template |
||
39 | * @return static |
||
40 | */ |
||
41 | public static function vars(bool $force = true): self |
||
54 | |||
55 | /** |
||
56 | * Converts data to one twig variable |
||
57 | * |
||
58 | * @param string $name Variable name |
||
59 | * @param bool $force Define the value of the variable even if it is passed to the template |
||
60 | * @return static |
||
61 | */ |
||
62 | public static function var(string $name, bool $force = true): self |
||
68 | |||
69 | public function convert(array $data): string |
||
75 | |||
76 | public static function valueToTwig($value): string |
||
90 | } |
||
91 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.