Swagger-codegen: [PHP] Can't run composer install when running PHP >= 7.2

Created on 4 Aug 2018  路  2Comments  路  Source: swagger-api/swagger-codegen

Description

I'm unable to install generated PHP clients on a system running PHP v7.2.8.

Swagger-codegen version

2.4.0-SNAPSHOT, built from latest sources (dbd0a4b).

Swagger declaration file content or url

Petstore example.

Command line used for generation
$ bin/php-perstore.sh
Steps to reproduce
$ php --version
PHP 7.2.8 (cli) (built: Jul 19 2018 15:54:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
$ cd samples/client/petstore/php/SwaggerClient-php && composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.                                           

  Problem 1
    - friendsofphp/php-cs-fixer v1.13.3 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.2.8) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v1.13.2 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.2.8) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v1.13.1 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.2.8) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v1.13.0 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.2.8) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v1.12.4 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.2.8) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v1.12.3 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.2.8) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v1.12.2 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.2.8) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v1.12.1 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.2.8) does not satisfy that requirement.
    - friendsofphp/php-cs-fixer v1.12.0 requires php ^5.3.6 || >=7.0 <7.2 -> your PHP version (7.2.8) does not satisfy that requirement.
    - Installation request for friendsofphp/php-cs-fixer ~1.12 -> satisfiable by friendsofphp/php-cs-fixer[v1.12.0, v1.12.1, v1.12.2, v1.12.3, v1.12.4, v1.13.0, v1.13.1, v1.13.2, v1.13.3].
Related issues/PRs

The dependency on friendsofphp/php-cs-fixer was introduced in https://github.com/swagger-api/swagger-codegen/pull/3863.

Suggest a fix/enhancement

The PHP client uses a package called friendsofphp/php-cs-fixer version 1.12, which is incompatible with PHP 7.2 and above. To fix we could upgrade the friendsofphp/php-cs-fixer dependency to a newer version that supports PHP >= 7.2, e.g. v2.12.

Most helpful comment

The same issue applies to 3.0.* - although the PR #8534 seems to be targeted to 3.0.0 and higher, it was merged to master but never merged into any of the 3.0 releases.

Are there any estimates when this will/could happen?

All 2 comments

The same issue applies to 3.0.* - although the PR #8534 seems to be targeted to 3.0.0 and higher, it was merged to master but never merged into any of the 3.0 releases.

Are there any estimates when this will/could happen?

@HugoMario all php clients generated with cli jars of versions 3.0.x have the same issue. Please review this issue.

Was this page helpful?
0 / 5 - 0 ratings