Skip to content

Commit 232ccee

Browse files
Merge pull request #9 from symfony2admingenerator/fix-nullable-php8.4
Fix nullable php8.4, remove old spaceless function
2 parents 331188d + c1d788e commit 232ccee

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

src/Builder/BuilderInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function getDefaultTemplateName(): string;
4949
*
5050
* @return string The short classname.
5151
*/
52-
function getSimpleClassName(string $class = null): string;
52+
function getSimpleClassName(?string $class = null): string;
5353

5454
function setOutputName(string $outputName): void;
5555

src/Builder/Generator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Generator
4141
*
4242
* @param string|null $baseTempDir Existing base directory for temporary template files
4343
*/
44-
public function __construct(string $baseTempDir = null)
44+
public function __construct(?string $baseTempDir = null)
4545
{
4646
if (null === $baseTempDir) {
4747
$baseTempDir = sys_get_temp_dir();

src/Extension/TwigPrintExtension.php

+1-19
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ public function getFunctions(): array
2828
'echo_endfor' => new TwigFunction('echo_endfor' , $this->getEchoEndFor(...), $options),
2929
'echo_raw' => new TwigFunction('echo_raw' , $this->getEchoRaw(...), $options),
3030
'echo_endraw' => new TwigFunction('echo_endraw' , $this->getEchoEndRaw(...), $options),
31-
'echo_spaceless' => new TwigFunction('echo_spaceless' , $this->getEchoSpaceless(...), $options),
32-
'echo_endspaceless' => new TwigFunction('echo_endspaceless', $this->getEchoEndSpaceless(...), $options),
3331
'echo_extends' => new TwigFunction('echo_extends' , $this->getEchoExtends(...), $options),
3432
'echo_if' => new TwigFunction('echo_if' , $this->getEchoIf(...), $options),
3533
'echo_else' => new TwigFunction('echo_else' , $this->getEchoElse(...), $options),
@@ -188,7 +186,7 @@ public function getEchoExtends(string $name): string
188186
* {{ echo_for('item', 'myListObject', 'key') }}
189187
* => {% for key,item in myListObject %}
190188
*/
191-
public function getEchoFor(string $object, string $in, string $key = null): string
189+
public function getEchoFor(string $object, string $in, ?string $key = null): string
192190
{
193191
return strtr(
194192
'{% for %%key%%%%object%% in %%in%% %}',
@@ -223,22 +221,6 @@ public function getEchoEndRaw(): string
223221
return '{% endraw %}';
224222
}
225223

226-
/**
227-
* Print "spaceless" tag
228-
*/
229-
public function getEchoSpaceless(): string
230-
{
231-
return '{% apply spaceless %}';
232-
}
233-
234-
/**
235-
* Print "endspaceless" tag
236-
*/
237-
public function getEchoEndSpaceless(): string
238-
{
239-
return '{% endapply %}';
240-
}
241-
242224
/**
243225
* Converts an array to a twig array expression (string).
244226
* Only in case a value contains '{{' and '}}' the value won't be

0 commit comments

Comments
 (0)