How do you enforce a consistent code style in your projects?

This page summarizes the projects mentioned and recommended in the original post on /r/laravel

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • GrumPHP

    A PHP code-quality tool

  • We use GrumPHP with the phpcs task and PSR12 preset () + some custom rules.

  • coding-standard

    Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs

  • Codesniffer. Though the requirements may differ between projects I typically use PSR12 as a starting point, plus disallowing long array syntax, enforcing a need for DocBlocks, and a few others. I find https://github.com/slevomat/coding-standard is also a good source of useful sniffs.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • laravel-code-style

    Discontinued Automatic code formatting for Laravel projects

  • You don‘t need to configure all these rulesets for phpcsfixer. Just use some presets and add/diable rules if it does not fit your style or use the laravel preset: https://github.com/matt-allan/laravel-code-style

  • phpcs-laravel

    Discontinued The PHP_Codesniffer configuration I use across Laravel projects

  • watson-text-to-speech-php

    IBM Watson text to speech API PHP

  • Watson text to speech side project, see .github/workflows/ for example.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts