Skip to content

Commit

Permalink
[PHP] Drop support for PHP5.5 on php-client (OpenAPITools#993)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ackintosh committed Sep 7, 2018
1 parent 45ac934 commit 3f6c98b
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
],
"require": {
"php": ">=5.5",
"php": ">=5.6",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0-SNAPSHOT
3.3.0-SNAPSHOT
33 changes: 19 additions & 14 deletions samples/client/petstore-security-test/php/OpenAPIClient-php/.php_cs
Original file line number Diff line number Diff line change
@@ -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__)
);
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=5.5",
"php": ">=5.6",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand All @@ -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/" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: [email protected] *_/ ' \" =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
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: [email protected] *_/ ' \" =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
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: [email protected] *_/ ' \" =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
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: [email protected] *_/ ' \" =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
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: [email protected] *_/ ' \" =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
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: [email protected] *_/ ' \" =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
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: [email protected] *_/ ' \" =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
*/

/**
Expand Down Expand Up @@ -68,7 +68,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n
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'");
}
Expand Down Expand Up @@ -287,7 +287,7 @@ public static function deserialize($data, $class, $httpHeaders = null)

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'");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=5.5",
"php": ">=5.6",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=5.5",
"php": ">=5.6",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand Down

0 comments on commit 3f6c98b

Please sign in to comment.