Search code examples
phpcomposer-phppackagist

Composer dependancy not available for PHPDOX


I am trying to install phpdox through composer.

"require": {
    "phploc/phploc": "2.0.6",
    "phpunit/phpunit": "4.2.4",
    "pdepend/pdepend": "2.0.0",
    "phpmd/phpmd": "2.0.0",
    "squizlabs/php_codesniffer": "2.0.0a2",
    "sebastian/phpcpd": "2.0.*@dev",
    "theseer/phpdox": "0.6.6.1"
}

Which produces the following:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

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
  - Installation request for theseer/phpdox 0.6.6.1 -> satisfiable by theseer/phpdox[0.6.6.1].
  - theseer/phpdox 0.6.6.1 requires nikic/php-parser >=1.0.0 -> no matching package found.

Potential causes:
  - A typo in the package name
  - The package is not available in a stable-enough version according to your minimum-stability setting

However, on the packagist website it says that phpdox has a dependency nikic/php-parser: >=1.0.0 which does not exist.

How do I resolve that?


Solution

  • The package nikic/php-parser has only been tagged as a beta version 1.0, not a stable release.

    theseer/phpdox does require that 1.0.0 version, however it has set minimum-stability:dev and prefer-stable:true in it's own composer.json. These settings can only be defined in the root composer.json.

    Two ways to fix it:

    1. Require the needed beta version of that package yourself: composer require nikic/php-parser:~1.0@beta would do it.
    2. Also set the settings for minimum stability to at least "beta" and add the prefer-stable flag to avoid getting ALL packages in beta stability.

    Reading the installation instructions I get the idea that you are not supposed to require this tool directly via Composer. I can't see a reason why not to do it, but this probably hasn't been anticipated. So optional step 3: Open a ticket on Github to get this issue fixed.