[PHP] Drop support for PHP5.5 on php-client (#993)

* Drop suport for PHP5.5 on php-client

* Update samples

bin/php-petstore.sh
bin/openapi3/php-petstore.sh

* Update security samples

bin/security/php-petstore.sh
This commit is contained in:
Akihito Nakano 2018-09-07 17:39:33 +09:00 committed by GitHub
parent 4a9b0a91aa
commit 1ead8bcca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 42 additions and 29 deletions

View File

@ -21,7 +21,7 @@
}
],
"require": {
"php": ">=5.5",
"php": ">=5.6",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",

View File

@ -0,0 +1,8 @@
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
composer.phar
/vendor/
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock

View File

@ -1,18 +1,23 @@
<?php
return Symfony\CS\Config::create()
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
return PhpCsFixer\Config::create()
->setUsingCache(true)
->fixers(
[
'ordered_use',
'phpdoc_order',
'short_array_syntax',
'strict',
'strict_param'
]
)
->finder(
Symfony\CS\Finder\DefaultFinder::create()
->in(__DIR__)
->setRules([
'@PSR2' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'array_syntax' => [ 'syntax' => 'short' ],
'strict_comparison' => true,
'strict_param' => true,
'no_trailing_whitespace' => false,
'no_trailing_whitespace_in_comment' => false,
'braces' => false,
'single_blank_line_at_eof' => false,
'blank_line_after_namespace' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('test')
->exclude('tests')
->in(__DIR__)
);

View File

@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=5.5",
"php": ">=5.6",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
@ -27,7 +27,7 @@
"require-dev": {
"phpunit/phpunit": "^4.8",
"squizlabs/php_codesniffer": "~2.6",
"friendsofphp/php-cs-fixer": "~1.12"
"friendsofphp/php-cs-fixer": "~2.12"
},
"autoload": {
"psr-4": { "OpenAPI\\Client\\" : "lib/" }

View File

@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.2.0-SNAPSHOT
* OpenAPI Generator version: 3.3.0-SNAPSHOT
*/
/**

View File

@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.2.0-SNAPSHOT
* OpenAPI Generator version: 3.3.0-SNAPSHOT
*/
/**

View File

@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.2.0-SNAPSHOT
* OpenAPI Generator version: 3.3.0-SNAPSHOT
*/
/**

View File

@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.2.0-SNAPSHOT
* OpenAPI Generator version: 3.3.0-SNAPSHOT
*/
/**

View File

@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.2.0-SNAPSHOT
* OpenAPI Generator version: 3.3.0-SNAPSHOT
*/
/**

View File

@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.2.0-SNAPSHOT
* OpenAPI Generator version: 3.3.0-SNAPSHOT
*/
/**

View File

@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.2.0-SNAPSHOT
* OpenAPI Generator version: 3.3.0-SNAPSHOT
*/
/**
@ -68,7 +68,7 @@ class ObjectSerializer
if ($value !== null
&& !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)
&& method_exists($openAPIType, 'getAllowableEnumValues')
&& !in_array($value, $openAPIType::getAllowableEnumValues())) {
&& !in_array($value, $openAPIType::getAllowableEnumValues(), true)) {
$imploded = implode("', '", $openAPIType::getAllowableEnumValues());
throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'");
}
@ -287,7 +287,7 @@ class ObjectSerializer
return new \SplFileObject($filename, 'r');
} elseif (method_exists($class, 'getAllowableEnumValues')) {
if (!in_array($data, $class::getAllowableEnumValues())) {
if (!in_array($data, $class::getAllowableEnumValues(), true)) {
$imploded = implode("', '", $class::getAllowableEnumValues());
throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'");
}

View File

@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=5.5",
"php": ">=5.6",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",

View File

@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=5.5",
"php": ">=5.6",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",