diff --git a/.github/workflows/samples-php8.yaml b/.github/workflows/samples-php8.yaml index 0d2941f6e3c..e1aca18ea87 100644 --- a/.github/workflows/samples-php8.yaml +++ b/.github/workflows/samples-php8.yaml @@ -16,6 +16,10 @@ jobs: strategy: fail-fast: false matrix: + php: + - "8.1" + - "8.2" + - "8.3" sample: # servers - samples/server/petstore/php-symfony/SymfonyBundle-php/ @@ -25,7 +29,7 @@ jobs: - name: Setup PHP with tools uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: "${{ matrix.php }}" tools: php-cs-fixer, phpunit - name: composer install working-directory: ${{ matrix.sample }} diff --git a/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache b/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache index 455b5586ef7..023b66c90f7 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache @@ -151,7 +151,7 @@ class Controller extends AbstractController * * @return array|null */ - private function exceptionToArray(\Throwable $exception = null): ?array + private function exceptionToArray(?\Throwable $exception = null): ?array { if (null === $exception) { return null; diff --git a/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache b/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache index 962a4cdb2d5..d992f8fb193 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache @@ -6,7 +6,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} * Constructor * @param array|null $data Associated array of property values initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { {{#parentSchema}} parent::__construct($data); diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php index abaf02d5b8c..e21a2f13813 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php @@ -161,7 +161,7 @@ class Controller extends AbstractController * * @return array|null */ - private function exceptionToArray(\Throwable $exception = null): ?array + private function exceptionToArray(?\Throwable $exception = null): ?array { if (null === $exception) { return null; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php index e7c2de6ce03..0ac640c0664 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php @@ -73,7 +73,7 @@ class ApiResponse * Constructor * @param array|null $data Associated array of property values initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { if (is_array($data)) { $this->code = array_key_exists('code', $data) ? $data['code'] : $this->code; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php index fc827e4ae73..1debfbf9c16 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php @@ -66,7 +66,7 @@ class Category * Constructor * @param array|null $data Associated array of property values initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { if (is_array($data)) { $this->id = array_key_exists('id', $data) ? $data['id'] : $this->id; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php index 2aa65aa47a7..47ee65e211c 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php @@ -100,7 +100,7 @@ class Order * Constructor * @param array|null $data Associated array of property values initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { if (is_array($data)) { $this->id = array_key_exists('id', $data) ? $data['id'] : $this->id; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php index 5f229ab6bb1..299b55f603e 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php @@ -106,7 +106,7 @@ class Pet * Constructor * @param array|null $data Associated array of property values initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { if (is_array($data)) { $this->id = array_key_exists('id', $data) ? $data['id'] : $this->id; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php index 7d669ab9bb0..f42c3e2bceb 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php @@ -65,7 +65,7 @@ class Tag * Constructor * @param array|null $data Associated array of property values initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { if (is_array($data)) { $this->id = array_key_exists('id', $data) ? $data['id'] : $this->id; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php index b15d7fef65d..aec38c6a73e 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php @@ -115,7 +115,7 @@ class User * Constructor * @param array|null $data Associated array of property values initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { if (is_array($data)) { $this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;