Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Grumphp Laravel Package

phpro/grumphp

GrumPHP is a Composer plugin that installs Git hooks to run quality checks on every commit. It executes configured tasks like tests and linters, blocks failing commits, and helps teams enforce coding standards and best practices automatically.

View on GitHub
Deep Wiki
Context7

FAQ

Table of content

How can I bypass GrumPHP

You shouldn't! It's to maintain clean and well formatted code. Don't make your co-worker pissed off again...

Note: use --no-verify or -n flag when you commit, this will bypass the pre-commit and commit-msg

up

Which parts of the code does GrumPHP scan

When running ./vendor/bin/grumphp run all files in the repository will be scanned. On pre-commit + commit-msg the changed files will be scanned. Most tasks work directly with these files, but there are some commands like git_blacklist that are able to check only the committed lines.

up

Does GrumPHP support Windows

Yes, he does. But there are some limitations.

PHPCS and PHPLint tasks fail on Windows 7

This is due to the cmd input limit on Windows. The problem is that the CLI input string on cmd.exe is limited to 8191 characters. Tasks like phplint and phpcs contain the paths to the files that are being checked. During a run command, the list of files wil exceed this amount which results in some strange errors on Windows.

up

How can I fix Composer require conflicts?

In some cases, you might get require conflicts between your project and GrumPHP for Composer packages.

For example, Magento 2 has the following requirement for symfony/console

"symfony/console": "~2.3, !=2.7.0"

On the other hand, grumPHP has this requirement

"symfony/console": "~2.7|~3.0"

If you run composer, you will get the following error message

Your requirements could not be resolved to an installable set of packages.

You can resolve this problem by adding the following (or similar) to the composer.json file of your project

"symfony/console": "v2.8.20 as v2.6.13"

up

Why is the unstaged/untracked file state being used?

GrumPHP can only work with the actual files on the filesystem.
This means that your unstaged changes and untracked files will be staged when GrumPHP checks your codebase.
It is possible to use the staged files by stashing your changes with the ignore_unstaged_changes parameter.
Do note that this parameter is risky and won't work with partial commits. More information can be found here.

up

How can I fix the SourceTree $PATH problem?

For example:

  • Warning: Unsupported declare 'strict_types' in vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 19
  • Parse error: parse error, expecting ';'' or'{'' in vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 87

SourceTree probably doesn't import your local $PATH variable before running the scripts. This causes a lot of issues like a different PHP version than the one installed locally or executables that can't be found.

You can fix this by adding following line to the top of the git hooks:

export PATH=/usr/local/bin:$PATH

up

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
cadot.eu/make
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky