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

drupol/php-conventions

Opinionated PHP conventions toolkit with presets for code style, static analysis, and QA tooling. Helps standardize projects quickly by providing shared configuration and automation-friendly defaults for common PHP workflows.

View on GitHub
Deep Wiki
Context7

Latest Stable Version GitHub stars Total Downloads License

PHP conventions

Description

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

Features

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 need.

Installation

composer require drupol/php-conventions --dev

If you're not using GrumPHP

Manually add to your composer.json file

"extra":
  {
    "grumphp":
      {
        "config-default-path": "vendor/drupol/php-conventions/config/php73/grumphp.yml",
      },
  }

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

Current choices are:

  • psr12

If you're using GrumPHP already

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

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

To add an extra GrumPHP task:

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

parameters:
  extra_tasks:
    infection:
      threads: 1
      test_framework: phpspec
      configuration: infection.json.dist
      min_msi: 60
      min_covered_msi: 60
  skip_tasks:
    - phpcsfixer

In conjunction with extra_tasks, use skip_tasks to skip tasks if needed.

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
    • composer_normalize
    • yamllint
    • jsonlint
    • phplint
    • twigcs
    • phpcsfixer
  • 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,phpstan

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.

To generate the changelog, use the following command:

docker-compose run auto_changelog  --commit-limit false --hide-credit --sort-commits date-desc --breaking-pattern ""BREAKING CHANGE: yes" --template keepachangelog -u
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.
terminal42/code-quality-tools
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