Our Standards And Why We Use Them

A presentation at We Are Developers World Congress 2021 in July 2021 in by Christopher Miller

Slide 1

Slide 1

Title Slide

Our Standards And Why We Use Them

Slide 2

Slide 2

Who Am I? Why Am I Here?

Why Can I talk about this (please note, the email address will no longer be relevant to me - visit the site for up to date info

Slide 3

Slide 3

Why Do We Need Standards?

Slide 4

Slide 4

What Is Our Stack

• Docker • Sass • Terraform • MySQL • AWS • Redis • PHP • HTML5 • Nginx • CSS3 • Laravel • Javascript • Inertia • Webpack • React

Slide 5

Slide 5

Key Takeaway

STANDARDS HELP - THEY ENABLE DEVELOPERS TO WORK TOGETHER BETTER - SI MPLIFIES CODE REVIEW - KEEPS CODE CONSISTENT ACROSS PROJECTS

Slide 6

Slide 6

PHP - The Standards We Apply

Slide 7

Slide 7

PHP Standards Are Our Centrepiece

• Linter • ECS • PHPStan • Enlightn • Tests Everything we do is thought in terms of the “hit by a bus” scenario If a developer were not available tomorrow, could someone else pick up their work?

Slide 8

Slide 8

Linter

Linter NOT JUST MAKING IT PRETTY

Slide 9

Slide 9

A Bad Code Example

Slide 10

Slide 10

Our Code Fails To Execute

Slide 11

Slide 11

Bringing In Some Packages

Slide 12

Slide 12

Now We Can See Whats Wrong

Slide 13

Slide 13

Our Code Fixed

Slide 14

Slide 14

Our Code Executes

Slide 15

Slide 15

Use Our Standards Packages

Slide 16

Slide 16

Bring Everything In

Bringing In All The Packages We Need “require dev”: { “jumptwentyfour/php coding standards”: “^0.0.1”, “jumptwentyfour/project analysers”: “^0.0.2”, “php parallel lint/php console highlighter”: “^0.5.0”, “php parallel lint/php parallel lint”: “^1.3”, },

Slide 17

Slide 17

And The Scripts For Composer

Slide 18

Slide 18

PHPStan Neon File

Slide 19

Slide 19

ECS.php

Slide 20

Slide 20

Publish Enlightn

Slide 21

Slide 21

Configure Enlightn

Slide 22

Slide 22

So What Are We Using Here

Slide 23

Slide 23

Why Linting?

Slide 24

Slide 24

Why Ecs?

Slide 25

Slide 25

What Standards Do We Apply?

Slide 26

Slide 26

Why PHPStan

Slide 27

Slide 27

Why Enlightn?

Slide 28

Slide 28

This Is Only A Part Of Our Standards