Skip to content

Commit

Permalink
PHP8.4 comptible, php-symfony resources (#20162)
Browse files Browse the repository at this point in the history
* matrix php build

* NullableTypeForNullDefaultValue

* update sample
  • Loading branch information
dmnlk authored Nov 24, 2024
1 parent 093a51e commit c831983
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/samples-php8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected function validate($data, $asserts = null): ?Response
*
* @return array|null
*/
private function exceptionToArray(\Throwable $exception = null): ?array
private function exceptionToArray(?\Throwable $exception = null): ?array
{
if (null === $exception) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c831983

Please sign in to comment.