diff --git a/src/Builder/BuilderInterface.php b/src/Builder/BuilderInterface.php index e4b7a41..d3ca112 100644 --- a/src/Builder/BuilderInterface.php +++ b/src/Builder/BuilderInterface.php @@ -49,7 +49,7 @@ function getDefaultTemplateName(): string; * * @return string The short classname. */ - function getSimpleClassName(string $class = null): string; + function getSimpleClassName(?string $class = null): string; function setOutputName(string $outputName): void; diff --git a/src/Builder/Generator.php b/src/Builder/Generator.php index a12fdce..b51de61 100644 --- a/src/Builder/Generator.php +++ b/src/Builder/Generator.php @@ -41,7 +41,7 @@ class Generator * * @param string|null $baseTempDir Existing base directory for temporary template files */ - public function __construct(string $baseTempDir = null) + public function __construct(?string $baseTempDir = null) { if (null === $baseTempDir) { $baseTempDir = sys_get_temp_dir(); diff --git a/src/Extension/TwigPrintExtension.php b/src/Extension/TwigPrintExtension.php index 86236f4..106ca4f 100644 --- a/src/Extension/TwigPrintExtension.php +++ b/src/Extension/TwigPrintExtension.php @@ -28,8 +28,6 @@ public function getFunctions(): array 'echo_endfor' => new TwigFunction('echo_endfor' , $this->getEchoEndFor(...), $options), 'echo_raw' => new TwigFunction('echo_raw' , $this->getEchoRaw(...), $options), 'echo_endraw' => new TwigFunction('echo_endraw' , $this->getEchoEndRaw(...), $options), - 'echo_spaceless' => new TwigFunction('echo_spaceless' , $this->getEchoSpaceless(...), $options), - 'echo_endspaceless' => new TwigFunction('echo_endspaceless', $this->getEchoEndSpaceless(...), $options), 'echo_extends' => new TwigFunction('echo_extends' , $this->getEchoExtends(...), $options), 'echo_if' => new TwigFunction('echo_if' , $this->getEchoIf(...), $options), 'echo_else' => new TwigFunction('echo_else' , $this->getEchoElse(...), $options), @@ -188,7 +186,7 @@ public function getEchoExtends(string $name): string * {{ echo_for('item', 'myListObject', 'key') }} * => {% for key,item in myListObject %} */ - public function getEchoFor(string $object, string $in, string $key = null): string + public function getEchoFor(string $object, string $in, ?string $key = null): string { return strtr( '{% for %%key%%%%object%% in %%in%% %}', @@ -223,22 +221,6 @@ public function getEchoEndRaw(): string return '{% endraw %}'; } - /** - * Print "spaceless" tag - */ - public function getEchoSpaceless(): string - { - return '{% apply spaceless %}'; - } - - /** - * Print "endspaceless" tag - */ - public function getEchoEndSpaceless(): string - { - return '{% endapply %}'; - } - /** * Converts an array to a twig array expression (string). * Only in case a value contains '{{' and '}}' the value won't be