Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ before_install:
#- sudo apt-get update
#- sudo apt-get install dart
# switch to php7
- phpenv global 7.1
- phpenv global 7.3
- php -v
# install perl module
#- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
Expand Down
6 changes: 5 additions & 1 deletion modules/openapi-generator/src/main/resources/php/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: php
# Bionic environment has preinstalled PHP from 7.1 to 7.4
# https://docs.travis-ci.com/user/reference/bionic/#php-support
dist: bionic
php:
- 7.1
- 7.2
- 7.3
- 7.4
before_install: "composer install"
script: "vendor/bin/phpunit"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* ApiException
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{invokerPackage}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Configuration
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{invokerPackage}}
Expand All @@ -20,7 +20,7 @@ namespace {{invokerPackage}};

/**
* Configuration Class Doc Comment
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{invokerPackage}}
Expand Down Expand Up @@ -427,35 +427,35 @@ class Configuration
*/
public function getHostSettings()
{
return array(
return [
{{#servers}}
array(
"url" => "{{{url}}}",
"description" => "{{{description}}}{{^description}}No description provided{{/description}}",
{{#variables}}
{{#-first}}
"variables" => array(
{{/-first}}
"{{{name}}}" => array(
"description" => "{{{description}}}{{^description}}No description provided{{/description}}",
"default_value" => "{{{defaultValue}}}",
{{#enumValues}}
{{#-first}}
"enum_values" => array(
{{/-first}}
"{{{.}}}"{{^-last}},{{/-last}}
{{#-last}}
)
{{/-last}}
{{/enumValues}}
){{^-last}},{{/-last}}
{{#-last}}
)
{{/-last}}
{{/variables}}
){{^-last}},{{/-last}}
[
"url" => "{{{url}}}",
"description" => "{{{description}}}{{^description}}No description provided{{/description}}",
{{#variables}}
{{#-first}}
"variables" => [
{{/-first}}
"{{{name}}}" => [
"description" => "{{{description}}}{{^description}}No description provided{{/description}}",
"default_value" => "{{{defaultValue}}}",
{{#enumValues}}
{{#-first}}
"enum_values" => [
{{/-first}}
"{{{.}}}"{{^-last}},{{/-last}}
{{#-last}}
]
{{/-last}}
{{/enumValues}}
]{{^-last}},{{/-last}}
{{#-last}}
]
{{/-last}}
{{/variables}}
]{{^-last}},{{/-last}}
{{/servers}}
);
];
}

/**
Expand All @@ -468,7 +468,7 @@ class Configuration
public function getHostFromSettings($index, $variables = null)
{
if (null === $variables) {
$variables = array();
$variables = [];
}

$hosts = $this->getHostSettings();
Expand All @@ -484,7 +484,7 @@ class Configuration
// go through variable and assign a value
foreach ($host["variables"] as $name => $variable) {
if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user
if (in_array($variables[$name], $variable["enum_values"])) { // check to see if the value is in the enum
if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum
$url = str_replace("{".$name."}", $variables[$name], $url);
} else {
throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"]).".");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* ApiException
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{invokerPackage}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* ModelInterface
*
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{modelPackage}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* ObjectSerializer
*
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{invokerPackage}}
Expand Down Expand Up @@ -192,7 +192,7 @@ class ObjectSerializer
{
if ($value instanceof \DateTime) { // datetime in ISO8601 format
return $value->format(self::$dateTimeFormat);
} else if (is_bool($value)) {
} elseif (is_bool($value)) {
return $value ? 'true' : 'false';
} else {
return $value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})

## Requirements

PHP 7.1 and later
PHP 7.2 and later

## Installation & Usage

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* {{classname}}
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{invokerPackage}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* {{classname}}Test
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{invokerPackage}}
Expand Down Expand Up @@ -37,28 +37,28 @@ use PHPUnit\Framework\TestCase;
/**
* Setup before running any test cases
*/
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
}

/**
* Setup before running each test case
*/
public function setUp()
public function setUp(): void
{
}

/**
* Clean up after running each test case
*/
public function tearDown()
public function tearDown(): void
{
}

/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
}
{{#operation}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.2",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"phpunit/phpunit": "^7.4",
"phpunit/phpunit": "^8.0 || ^9.0",
"friendsofphp/php-cs-fixer": "^2.12"
},
"autoload": {
Expand Down
8 changes: 7 additions & 1 deletion modules/openapi-generator/src/main/resources/php/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ composer.phar

# 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
composer.lock

# php-cs-fixer cache
.php_cs.cache

# PHPUnit cache
.phpunit.result.cache
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* {{classname}}
*
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{invokerPackage}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* {{classname}}Test
*
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package {{invokerPackage}}
Expand Down Expand Up @@ -38,28 +38,28 @@ class {{classname}}Test extends TestCase
/**
* Setup before running any test case
*/
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
}

/**
* Setup before running each test case
*/
public function setUp()
public function setUp(): void
{
}

/**
* Clean up after running each test case
*/
public function tearDown()
public function tearDown(): void
{
}

/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
}

Expand Down
8 changes: 7 additions & 1 deletion samples/client/petstore/php/OpenAPIClient-php/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ composer.phar

# 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
composer.lock

# php-cs-fixer cache
.php_cs.cache

# PHPUnit cache
.phpunit.result.cache
6 changes: 5 additions & 1 deletion samples/client/petstore/php/OpenAPIClient-php/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: php
# Bionic environment has preinstalled PHP from 7.1 to 7.4
# https://docs.travis-ci.com/user/reference/bionic/#php-support
dist: bionic
php:
- 7.1
- 7.2
- 7.3
- 7.4
before_install: "composer install"
script: "vendor/bin/phpunit"
2 changes: 1 addition & 1 deletion samples/client/petstore/php/OpenAPIClient-php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This PHP package is automatically generated by the [OpenAPI Generator](https://o

## Requirements

PHP 7.1 and later
PHP 7.2 and later

## Installation & Usage

Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/php/OpenAPIClient-php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.2",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"phpunit/phpunit": "^7.4",
"phpunit/phpunit": "^8.0 || ^9.0",
"friendsofphp/php-cs-fixer": "^2.12"
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* AnotherFakeApi
* PHP version 7.1
* PHP version 7.2
*
* @category Class
* @package OpenAPI\Client
Expand Down
Loading