forked from loafle/openapi-generator-original
PHP8.4 comptible, php-symfony resources (#20162)
* matrix php build * NullableTypeForNullDefaultValue * update sample
This commit is contained in:
parent
093a51ee21
commit
c831983866
6
.github/workflows/samples-php8.yaml
vendored
6
.github/workflows/samples-php8.yaml
vendored
@ -16,6 +16,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
php:
|
||||||
|
- "8.1"
|
||||||
|
- "8.2"
|
||||||
|
- "8.3"
|
||||||
sample:
|
sample:
|
||||||
# servers
|
# servers
|
||||||
- samples/server/petstore/php-symfony/SymfonyBundle-php/
|
- samples/server/petstore/php-symfony/SymfonyBundle-php/
|
||||||
@ -25,7 +29,7 @@ jobs:
|
|||||||
- name: Setup PHP with tools
|
- name: Setup PHP with tools
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: "${{ matrix.php }}"
|
||||||
tools: php-cs-fixer, phpunit
|
tools: php-cs-fixer, phpunit
|
||||||
- name: composer install
|
- name: composer install
|
||||||
working-directory: ${{ matrix.sample }}
|
working-directory: ${{ matrix.sample }}
|
||||||
|
@ -151,7 +151,7 @@ class Controller extends AbstractController
|
|||||||
*
|
*
|
||||||
* @return array|null
|
* @return array|null
|
||||||
*/
|
*/
|
||||||
private function exceptionToArray(\Throwable $exception = null): ?array
|
private function exceptionToArray(?\Throwable $exception = null): ?array
|
||||||
{
|
{
|
||||||
if (null === $exception) {
|
if (null === $exception) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -6,7 +6,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
|
|||||||
* Constructor
|
* Constructor
|
||||||
* @param array|null $data Associated array of property values initializing the model
|
* @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}}
|
{{#parentSchema}}
|
||||||
parent::__construct($data);
|
parent::__construct($data);
|
||||||
|
@ -161,7 +161,7 @@ class Controller extends AbstractController
|
|||||||
*
|
*
|
||||||
* @return array|null
|
* @return array|null
|
||||||
*/
|
*/
|
||||||
private function exceptionToArray(\Throwable $exception = null): ?array
|
private function exceptionToArray(?\Throwable $exception = null): ?array
|
||||||
{
|
{
|
||||||
if (null === $exception) {
|
if (null === $exception) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -73,7 +73,7 @@ class ApiResponse
|
|||||||
* Constructor
|
* Constructor
|
||||||
* @param array|null $data Associated array of property values initializing the model
|
* @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)) {
|
if (is_array($data)) {
|
||||||
$this->code = array_key_exists('code', $data) ? $data['code'] : $this->code;
|
$this->code = array_key_exists('code', $data) ? $data['code'] : $this->code;
|
||||||
|
@ -66,7 +66,7 @@ class Category
|
|||||||
* Constructor
|
* Constructor
|
||||||
* @param array|null $data Associated array of property values initializing the model
|
* @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)) {
|
if (is_array($data)) {
|
||||||
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
||||||
|
@ -100,7 +100,7 @@ class Order
|
|||||||
* Constructor
|
* Constructor
|
||||||
* @param array|null $data Associated array of property values initializing the model
|
* @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)) {
|
if (is_array($data)) {
|
||||||
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
||||||
|
@ -106,7 +106,7 @@ class Pet
|
|||||||
* Constructor
|
* Constructor
|
||||||
* @param array|null $data Associated array of property values initializing the model
|
* @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)) {
|
if (is_array($data)) {
|
||||||
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
||||||
|
@ -65,7 +65,7 @@ class Tag
|
|||||||
* Constructor
|
* Constructor
|
||||||
* @param array|null $data Associated array of property values initializing the model
|
* @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)) {
|
if (is_array($data)) {
|
||||||
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
||||||
|
@ -115,7 +115,7 @@ class User
|
|||||||
* Constructor
|
* Constructor
|
||||||
* @param array|null $data Associated array of property values initializing the model
|
* @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)) {
|
if (is_array($data)) {
|
||||||
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
$this->id = array_key_exists('id', $data) ? $data['id'] : $this->id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user