Skip to content

[PHP] Can't run composer install when running PHP >= 7.2 #8533

@mattmelling

Description

@mattmelling
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 #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions