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

Allow symfony/console 6 #44

Open
tvbeek opened this issue Jan 26, 2022 · 5 comments
Open

Allow symfony/console 6 #44

tvbeek opened this issue Jan 26, 2022 · 5 comments

Comments

@tvbeek
Copy link
Contributor

tvbeek commented Jan 26, 2022

I'm updating a Laravel package and Laravel 9 use Symfony 6. Currently it isn't possible to use that in combination with this package.

The Changelog for symfony/console 6 is: https://github.com/symfony/console/blob/6.0/CHANGELOG.md

I currently didn't yet have the time to create a PR and test it. I hope to find some time in the future but thought it was a good idea to create an issue.

@tvbeek
Copy link
Contributor Author

tvbeek commented Jan 31, 2022

First check for packages that result in work to allow version 6:

  • Phan does allow version 6 but that isn't yet included in a new release.
  • overtrue/phplint allows symfony/console 6 since version 4.1.0 but the project use ^1.2
  • psalm allows symfony/console 6 since version 4.12.0 but the project use ^3.8
  • friendsofphp/php-cs-fixer symfony/console 6 since version 3.4.0 but for some reasons I didn't yet find out I don't get a V3 version installed.

@jelovac
Copy link

jelovac commented Feb 9, 2022

Hi @tvbeek,

Since this package is a tool (binary) and not a direct code dependency in terms you need it to run your code I think it is wrong to put this package as dependency in your main project composer.json. Instead you should create another composer.json under some directory and install the package there. That way you are not dependent on your project dependencies.

This also suggested by the PHP-CS-Fixer: https://github.com/FriendsOfPHP/PHP-CS-Fixer#installation

Here is an example how I would do it:

"scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts",
            "[ $COMPOSER_DEV_MODE -eq 0 ] || composer run install-dev-tools"
        ],
        "post-update-cmd": [
            "@auto-scripts",
            "[ $COMPOSER_DEV_MODE -eq 0 ] || composer run update-dev-tools"
        ],
        "install-dev-tools": [
            "@php composer install --working-dir tools/php-cs-fixer",
            "@php composer install --working-dir tools/gitlab-code-quality-converter"
        ],
        "update-dev-tools": [
            "@php composer update --working-dir tools/php-cs-fixer",
            "@php composer update --working-dir tools/gitlab-code-quality-converter"
        ],
        "code-lint": [
            "@php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix -vvv --show-progress=dots"
        ],
    },

Then in your tools/gitlab-code-quality-converter/composer.json you would have like this:

{
  "require": {
    "php": ">=8.0", // Needs to match the PHP version in your project composer.json if you intend to run the tool from the same php environment
    "beechit/json-to-code-climate-subset-converter": "^1.6"
  }
}

Since this tool is mostly needed to solve GitLab multiple Code Quality reports limitation you might just run the tool from a Docker image and keep your project code free of it.

@asanikovich
Copy link

Any news?

@ttomdewit
Copy link
Contributor

Any news?

Not at the moment, I'll find some time this week to clean up open issues and PRs. No promise or commitment, but I'll do what I can.

@asanikovich
Copy link

Since this package is a tool (binary) and not a direct code dependency in terms you need it to run your code I think it is wrong to put this package as dependency in your main project composer.json. Instead you should create another composer.json under some directory and install the package there. That way you are not dependent on your project dependencies.

it helps me to install under another directory

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

No branches or pull requests

4 participants