From 66cd0e58648bdba3e854203534fd27fe0fb5d1e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 30 Apr 2024 14:50:20 +0200 Subject: [PATCH] Fix explicit nullable parameter for PHP 8.4 compatibility --- .php-cs-fixer.dist.php | 1 + composer.json | 5 +++++ src/ArrayToXml.php | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 3600d2d..35e1851 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -40,5 +40,6 @@ 'keep_multiple_spaces_after_comma' => true, ], 'single_trait_insert_per_statement' => true, + 'nullable_type_declaration_for_default_null_value' => true, ]) ->setRiskyAllowed(true); diff --git a/composer.json b/composer.json index df8cd3a..2b9f69b 100755 --- a/composer.json +++ b/composer.json @@ -38,6 +38,11 @@ "scripts": { "test": "vendor/bin/pest" }, + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "config": { "allow-plugins": { "pestphp/pest-plugin": true diff --git a/src/ArrayToXml.php b/src/ArrayToXml.php index 6879692..3c016a4 100644 --- a/src/ArrayToXml.php +++ b/src/ArrayToXml.php @@ -68,10 +68,10 @@ public static function convert( array $array, $rootElement = '', bool $replaceSpacesByUnderScoresInKeyNames = true, - string $xmlEncoding = null, + ?string $xmlEncoding = null, string $xmlVersion = '1.0', array $domProperties = [], - bool $xmlStandalone = null, + ?bool $xmlStandalone = null, bool $addXmlDeclaration = true, array $options = ['convertNullToXsiNil' => false] ): string {