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

Php Conventions Laravel Package

ecphp/php-conventions

Predefined GrumPHP configuration for PHP projects at the European Commission. Adds quality checks via git hooks (or manual runs): license file, composer validation/normalization, linters (YAML/JSON/PHP), Twig CS, PHP-CS-Fixer, PHPCS, PHPStan, Psalm.

View on GitHub
Deep Wiki
Context7

Latest Stable Version GitHub stars Total Downloads License

ECPHP PHP conventions

Description

A developer tool which provides a pre-defined GrumPHP configuration tailored specifically for PHP development at European Commission.

This package has been inspired by drupol/php-conventions and ergebnis/php-library-template.

Features

Based on GrumPHP, this tool will run a set of quality control tools via a git hook. The user is free to disable the git hook and run the tool manually instead, see the documentation to know more about that.

The default GrumPHP configuration ships with the following checks:

It provides a default configuration for each task, and they are customizable at will through a simple YAML configuration file.

Tasks can be also added or skipped according to your needs.

Installation

composer require ecphp/php-conventions --dev

Add or edit the file grumphp.yml.dist or grumphp.yml and add on the top it:

imports:
  - { resource: vendor/ecphp/php-conventions/config/php73/grumphp.yml }

Replace the string php73 with the minimal version of PHP you want to support.

Current choices are:

  • psr12
  • php73
  • php74 (Not available yet)

You may configure everything from that file.

To add an extra task or skip a task:

imports:
  - { resource: vendor/ecphp/php-conventions/config/php73/grumphp.yml }

parameters:
  extra_tasks:
    phpunit: ~
  skip_tasks:
    - phpstan

To edit the configuration of a particular existing task

imports:
  - { resource: vendor/ecphp/php-conventions/config/php73/grumphp.yml }

parameters:
  tasks.license.holder: <License holder here>
  tasks.license.name: BSD-3-Clause # MIT and EUPL-1.2 are also available
  tasks.license.date_from: 2019

Find all the available customizable properties in the imported file on the top of the YAML file.

Usage

Basic usage

vendor/bin/grumphp run

This will run all the pre-configured tasks.

Advanced usage

If you're willing to specify a group of tasks only, you can use the pre-defined test suites.

Available test-suites are:

  • cs
    • license
    • composer_require_checker
    • composer
    • composer_normalize
    • yamllint
    • jsonlint
    • phplint
    • twigcs
    • phpcsfixer
    • phpcs
  • static-analysis
    • phpstan
    • psalm

To run a particular test-suite:

vendor/bin/grumphp run --testsuite=cs

To run particular tasks:

vendor/bin/grumphp run --tasks=phpcsfixer,phpcs

Contributing

Report bug on the issue tracker.

See the file CONTRIBUTING.md but feel free to contribute to this library by sending Github pull requests.

Changelog

See CHANGELOG.md for a changelog based on git commits.

For more detailed changelogs, please check the release changelogs.

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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
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
spatie/mailcoach-vapor