Skip to content

Commit c1d788e

Browse files
committed
Fix implicit nullable variables causing a deprecation warning in PHP 8.4
1 parent da5270c commit c1d788e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
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-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function getEchoExtends(string $name): string
186186
* {{ echo_for('item', 'myListObject', 'key') }}
187187
* => {% for key,item in myListObject %}
188188
*/
189-
public function getEchoFor(string $object, string $in, string $key = null): string
189+
public function getEchoFor(string $object, string $in, ?string $key = null): string
190190
{
191191
return strtr(
192192
'{% for %%key%%%%object%% in %%in%% %}',

0 commit comments

Comments
 (0)