Closed brayniverse closed 9 months ago
I'm happy to submit a pull request to resolve this issue. But first I'd need someone in charge to tell me what you'd like me to do first.
I was thinking of adding squizlabs/php_codesniffer
as a dev dependency and creating src/MezzioInstaller/Resources/phpcs.xml.dist
with config similar to the current phpcs.xml.dist
but with the PSR12 standard instead of LaminasCodingStandard
, then making sure it replaces the original phpcs.xml.dist
after install.
Please let me know if there is anything I can do to help.
Interesting observation. I usually do add laminas-coding-standard
manually but also remove the script
section from composer.json
as I do not rely on these.
Adding laminas-coding-standard
to a newly created project is trivial. The question I have, is, is it really desired to ship laminas-coding-standard
with the skeleton? What if someone prefers friendsofphp/php-cs-fixer
or doctrine/coding-standard
?
It would be possible to add a choice during installation. Personally I'd rather not and let the user decide what coding standard, static code analysis tool etc. he/she would like to install. I would vote for removing the cs-related scripts from composer.json
.
I would be happy with removing PHP CS entirely and installing it myself with each project. But having it there pre-installed and pre-configured would definitely be convenient for me and possibly newcomers to the framework who might not yet have experience with automated coding standards.
So long as it's either removed completely to avoid confusion or working on a fresh install I'm happy.
Hi @froschdesign @Ocramius.
Sorry to bother you both but you interacted with me on a PR I submitted recently so I assume you're both working on this repository at the moment.
I would like to help resolve this issue. Is there anything I can do to help? As I said in an earlier comment, I'm happy to put together a pull request if you can give me directions on what you'd like to be done.
Send a patch: easier to review a diff.
Working on it.
$ composer check
phpcs sh: phpcs: command not found Script phpcs handling the cs-check event returned with error code 127 Script @cs-check was called via check
Bug Report
Probably affects other versions but I'm fairly sure that's the version I installed.
Summary
PHPCS comes installed via
laminas/laminas-coding-standard
but that is removed after the installer script is run. As a result thecomposer check
andcomposer cs-check
commands are broken.Current behavior
When you run
composer check
you get the following error message:If you manually install
squizlabs/php_codesniffer
it will find PHPCS but then you get the following error:How to reproduce
Install a fresh instance of mezzio/mezzio-skeleton either using
composer create-project mezzio/mezzio-skeleton
or by manually cloning the repository and runningcomposer install
orcomposer update
.Once installed run the
composer check
orcomposer cs-check
commands.Expected behavior
I would expect to see the output from PHPCS.