Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoboFile related error #189

Closed
Guite opened this issue Nov 7, 2019 · 7 comments
Closed

RoboFile related error #189

Guite opened this issue Nov 7, 2019 · 7 comments

Comments

@Guite
Copy link

Guite commented Nov 7, 2019

Hello,

trying to get PHPQA running in a CI job using GitHub actions. But I am not able to cope with an error message - maybe just an obvious beginner issue.

Here is what I did so far:

Installed version 1.23.2 using composer.

Added a .phpqa.yml file containing:

phpqa.analyzedDirs: ./src/
phpqa.ignoredDirs: vendor
phpqa.report: true
phpqa.output: cli

Running these commands:

php ./vendor/bin/phpqa-extensions.php --add phpa phpca phpmnd

./vendor/bin/phpqa

Which results in this error:

PHP Fatal error:  Uncaught Error: Class 'RoboFile' not found in /home/runner/work/.../vendor/consolidation/robo/src/Runner.php:61
Stack trace:
#0 /home/runner/work/.../vendor/edgedesign/phpqa/phpqa(55): Robo\Runner->execute(Array)
#1 {main}
  thrown in /home/runner/work/.../vendor/consolidation/robo/src/Runner.php on line 61

Originally I had no YAML file, but added the parameters as CLI arguments. Did not change anything, same error occured.

Any idea what I am missing here?

@zdenekdrahos
Copy link
Member

Please add configuration file for GitHub actions.

@Guite
Copy link
Author

Guite commented Nov 8, 2019

Here is a test file:

test-phpqa.yml.txt

@zdenekdrahos
Copy link
Member

Could copy-paste it here? I see blank page in test-phpqa.yml.txt.

I need to see some github actions config that uses phpqa and causes Uncaught Error: Class 'RoboFile'. No .phpqa.yml is necessary. Just run ./vendor/bin/phpqa tools.

@Guite
Copy link
Author

Guite commented Nov 8, 2019

Running ./vendor/bin/phpqa tools on my local machine results in the same error.

Please try with this composer.json file:

{
    "name": "acme/phpqatest",
    "description": "Just a test file",
    "version": "1.0.0",
    "authors": [
        {
            "name": "Your name",
            "email": "test@example.org"
        }
    ],
    "require": {
        "php": ">=7.2.0"
    },
    "require-dev": {
        "jakub-onderka/php-parallel-lint": "^1",
        "jakub-onderka/php-console-highlighter": "^0",
        "phpunit/phpunit": "^8",
        "friendsofphp/php-cs-fixer": "^2",
        "nunomaduro/phpinsights": "^1",
        "phan/phan": "^2",
        "phpstan/phpstan": "^0",
        "phpstan/phpstan-doctrine": "^0",
        "phpstan/phpstan-phpunit": "^0",
        "phpstan/phpstan-symfony": "^0",
        "sensiolabs/security-checker": "^6",
        "vimeo/psalm": "^3",
        "edgedesign/phpqa": "^1",
        "macfja/phpqa-extensions": "^0",
        "povils/phpmnd": "^2",
        "rskuipers/php-assumptions": "^0",
        "wapmorgan/php-code-analyzer": "^1",
        "theseer/phpdox": "^0"
    },
    "suggest": {
    },
    "config": {
        "vendor-dir": "vendor",
        "preferred-install": "dist",
        "optimize-autoloader": true,
        "sort-packages": true
    }
}

Do this:

composer install
./vendor/bin/phpqa tools

You should see the error then.

@zdenekdrahos
Copy link
Member

You have weird composer.json. At first composer install failed:

$ 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
    - povils/phpmnd v2.0.0 requires jakub-onderka/php-console-highlighter ^0.3.2 -> satisfiable by jakub-onderka/php-console-highlighter[v0.3.2].
    - povils/phpmnd v2.1.0 requires jakub-onderka/php-console-highlighter ^0.3.2 -> satisfiable by jakub-onderka/php-console-highlighter[v0.3.2].
    - Conclusion: don't install jakub-onderka/php-console-highlighter v0.3.2
    - Installation request for povils/phpmnd ^2 -> satisfiable by povils/phpmnd[v2.0.0, v2.1.0].

It worked after deleting jakub-onderka packages. But historical Robo version is installed (default composer.lock contains v0.7.2).

  - Installing consolidation/robo (0.1.1): Downloading (100%)         

I can't really help you with that. It's dependency issue, maybe caused by https://github.com/MacFJA/phpqa-extensions. I would start with empty composer.json. At first require phpqa. Then require additional packages.

@Guite
Copy link
Author

Guite commented Nov 8, 2019

Thank you for this helpful pointer. I will investigate it.

@Guite
Copy link
Author

Guite commented Nov 8, 2019

For reference: the conflict is caused between nunomaduro/phpinsights and consolidation/robo which require different versions of league/container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants