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

A5f6a4724de2c2986c8cbd4f46d52a7c?s=128

Gabriel Caruso

May 10, 2019
Tweet

Transcript

  1. 2.

    Who am I? • Backend Developer at Leroy Merlin •

    PHP enthusiastic • PHPSP member • OSS contributor • Refactor/Stickers/ELEPHANTS lover
  2. 15.

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

    Continuous Integration - A step in the CI tool to

    report any fail - Git hooks to avoid commits with fails
  4. 18.

    Git - Git blame can be overwritten - Git bisect

    reports false-positives - Creates unnecessary “fix cs” commits
  5. 20.

    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