Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What are Coding Standards in PHP

What are Coding Standards in PHP

This talk will approach a theme that, for many of us, judge it unnecessary for our applications, but it has extreme importance to accelerate the code review process, focusing only on business logic. Will be shown what are Coding Standards, how to implement a tool to automate this process and promote the debate that good practices in programming can become Coding Standard rules.

Video: https://youtu.be/PIv2rmb1w1Q

Gabriel Caruso

May 10, 2019

More Decks by Gabriel Caruso

Other Decks in Programming


  1. Who am I? • Backend Developer at Leroy Merlin •

    PHP enthusiastic • PHPSP member • OSS contributor • Refactor/Stickers/ELEPHANTS lover
  2. Differences PHP-CS-Fixer • Fixers • Only work fixing code •

    Array syntax to configure • Focus only in Coding Standards • Easy to create Fixers PHP_CodeSniffer • Linters • Can only alert without fixing • XML syntax to configure • Flexible for Code Design and Mess Detector • Harder to create Sniffs
  3. Continuous Integration - A step in the CI tool to

    report any fail - Git hooks to avoid commits with fails
  4. Git - Git blame can be overwritten - Git bisect

    reports false-positives - Creates unnecessary “fix cs” commits
  5. Roadmap Coding Standards First step, not changing any logic Strict

    Programming Helps to define the strict code style PHP 7 Scalar Type Hints Review your codebase to avoid false-positives Strict types Last step, closing the circle