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

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

Our great sponsors
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • SonarLint - Clean code begins in your IDE with SonarLint
  • 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

    Build time-series-based applications quickly and at scale.. InfluxDB is the Time Series Platform where developers build real-time applications for analytics, IoT and cloud-native services. Easy to start, it is available in the cloud or on-premises.

  • laravel-code-style

    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

    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.

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

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