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

Symfony 5 support #135

Open
kacperjurak opened this issue Dec 28, 2019 · 3 comments
Open

Symfony 5 support #135

kacperjurak opened this issue Dec 28, 2019 · 3 comments

Comments

@kacperjurak
Copy link

Hello,
Is there a chance for Symfony 5 support?
Best Regards

root@a0f26d661718:/var/www/html# composer require bruli/php-git-hooks --dev
Using version ^5.9 for bruli/php-git-hooks
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.0.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for bruli/php-git-hooks ^5.9 -> satisfiable by bruli/php-git-hooks[v5.9].
    - bruli/php-git-hooks v5.9 requires symfony/dependency-injection ~4.0 -> no matching package found.

@afasciaux
Copy link

Hi,
Same here but no answer since 1 year, seems no fix for SF 5 support ?

@carlos-mg89
Copy link

It's been a while since Symfony 5 got out there, and now we're in Symfony 5.2, with 5.3 about to be released.

I understand the project might be out of interest for the maintainer, but if you read this, I might be able to help with a PR that deals with this compatibility upgrade for Symfony 5.X. I would only need a confirmation that you will review the PR and if it tests pass and you think is valuable, then publish a new release.

Thanks in advance

P.S. In case the maintainer is busy, does anyone know a replacement for this package that performs similar tasks and is compatible with Symfony 5.x ?

@carlos-mg89
Copy link

I've managed to find a really nice alternative to this dependency. pre-commit software is described as:

A framework for managing and maintaining multi-language pre-commit hooks

So this is a replacement not only for this project, which is PHP focused, but to many programming languages.

I've been playing with it, and the setup is very simple:

  1. Install pre-commit => https://pre-commit.com/#install
  2. Create a .pre-commit-config.yaml file in the root of your project
  3. As described in the official page ( https://pre-commit.com/hooks.html ), check your programming languages hooks, since it's quite likely that someone else has already set this up for you. It's the case for PHP: https://github.com/digitalpulp/pre-commit-php

This is the setup I've implemented for my Symfony 5 project:

repos:
  - repo: https://github.com/digitalpulp/pre-commit-php.git
    rev: 1.4.0
    hooks:
      - id: php-lint-all
      - id: php-unit
      - id: php-cs
        files: \.(php)$
        args: [ --standard=PSR2 -p ]

You can manually run the hook with this command:

pre-commit run --all-files

Or simply wait until you make a commit, and see the automated run of the above command :)

Have fun!

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

3 participants