Slide 1

Slide 1 text

Modern PHP is Amazing You Can Use It Today @stauffermatt A N D Why How

Slide 2

Slide 2 text

Matt Stauffer @stauffermatt

Slide 3

Slide 3 text

Gainesville

Slide 4

Slide 4 text

My history Graphic Design

Slide 5

Slide 5 text

My history Graphic Design Frontend

Slide 6

Slide 6 text

My history Graphic Design Frontend Hacky PHP & Wordpress

Slide 7

Slide 7 text

My history Graphic Design Frontend Hacky PHP & Wordpress Left for 5 years

Slide 8

Slide 8 text

My history Graphic Design Frontend Hacky PHP & Wordpress CodeIgniter Left for 5 years

Slide 9

Slide 9 text

My history Graphic Design Frontend Hacky PHP & Wordpress CodeIgniter Expression Engine Left for 5 years

Slide 10

Slide 10 text

My history Graphic Design Frontend Hacky PHP & Wordpress CodeIgniter Expression Engine Rails Left for 5 years

Slide 11

Slide 11 text

My history Graphic Design Frontend Hacky PHP & Wordpress CodeIgniter Expression Engine Rails Laravel Left for 5 years

Slide 12

Slide 12 text

My history Graphic Design Frontend Hacky PHP & Wordpress CodeIgniter Expression Engine Rails Laravel General Good Developer-y Stuff Left for 5 years

Slide 13

Slide 13 text

Who are we?

Slide 14

Slide 14 text

Who are we? Self-taught

Slide 15

Slide 15 text

Who are we? Self-taught Wordpress, EE, CI, etc.

Slide 16

Slide 16 text

Who are we? Self-taught Wordpress, EE, CI, etc. Bootstrappy small-to-medium companies

Slide 17

Slide 17 text

Who are we? Self-taught Wordpress, EE, CI, etc. Bootstrappy small-to-medium companies “Lone cowboy” types*

Slide 18

Slide 18 text

Our tools are holding us back. THE PROBLEM:

Slide 19

Slide 19 text

Our tools are holding us back. THE PROBLEM: (certain of)

Slide 20

Slide 20 text

Our tools are holding us back. THE PROBLEM: (certain of) THE SOLUTION:

Slide 21

Slide 21 text

Our tools are holding us back. THE PROBLEM: (certain of) Fix (or ditch) them. THE SOLUTION:

Slide 22

Slide 22 text

Disclaimers:

Slide 23

Slide 23 text

Disclaimers: 1. You might already know this

Slide 24

Slide 24 text

Disclaimers: 1. You might already know this 2. This may be totally overwhelming

Slide 25

Slide 25 text

Disclaimers: 1. You might already know this 2. This may be totally overwhelming 3. Easiest in modern environments

Slide 26

Slide 26 text

Disclaimers: 1. You might already know this 2. This may be totally overwhelming 3. Easiest in modern environments 4. One size fits some

Slide 27

Slide 27 text

5 LESSONS TO MAKE YOUR PHP BETTER

Slide 28

Slide 28 text

Embrace the Object Object Oriented PHP LESSON 1

Slide 29

Slide 29 text

Classic PHP is { procedural }

Slide 30

Slide 30 text

Slide 31

Slide 31 text

Slide 32

Slide 32 text

'Chuck E Cheese', 'screenshot' => 'images/portfolio/ chuck01.jpg' Procedural PHP

Slide 33

Slide 33 text

'Chuck E Cheese', 'screenshot' => 'images/portfolio/ chuck01.jpg' contact-us.ph if(isset($_POST)) $results = va if ($results include_o } else { $errors = } Procedural PHP

Slide 34

Slide 34 text

hydrate($properties); } ! public function getRelatedImages() { if ($this->cache_images === null) { $this->cacheRelatedImages(); } ! return $this->cache_images; } ! protected function hydrate(array $properties) Object-Oriented PHP

Slide 35

Slide 35 text

hydrate($properties); } ! public function getRelatedImages() { if ($this->cache_images === null) { $this->cacheRelatedImages(); } ! return $this->cache_images; } ! protected function hydrate(array $properties) Name Object-Oriented PHP

Slide 36

Slide 36 text

hydrate($properties); } ! public function getRelatedImages() { if ($this->cache_images === null) { $this->cacheRelatedImages(); } ! return $this->cache_images; } ! protected function hydrate(array $properties) Name Properties Object-Oriented PHP

Slide 37

Slide 37 text

hydrate($properties); } ! public function getRelatedImages() { if ($this->cache_images === null) { $this->cacheRelatedImages(); } ! return $this->cache_images; } ! protected function hydrate(array $properties) Name Properties Constructor Object-Oriented PHP

Slide 38

Slide 38 text

hydrate($properties); } ! public function getRelatedImages() { if ($this->cache_images === null) { $this->cacheRelatedImages(); } ! return $this->cache_images; } ! protected function hydrate(array $properties) Name Properties Constructor Public method Object-Oriented PHP

Slide 39

Slide 39 text

hydrate($properties); } ! public function getRelatedImages() { if ($this->cache_images === null) { $this->cacheRelatedImages(); } ! return $this->cache_images; } ! protected function hydrate(array $properties) Name Properties Constructor Public method Protected method Object-Oriented PHP

Slide 40

Slide 40 text

! ! ! ! ! !

= $item->title; ?>

!

Images

!
    getRelatedImages() as $image): ?>
  • <?= $image->alt; ?>

Slide 41

Slide 41 text

PHP is an OOP late bloomer 2007 2015 2011 2003 1999 1995

Slide 42

Slide 42 text

PHP is an OOP late bloomer 2007 2015 2011 2003 1999 1995 PHP released 1995

Slide 43

Slide 43 text

PHP is an OOP late bloomer 2007 2015 2011 2003 1999 1995 PHP 5.3 (true OOP) PHP released 1995

Slide 44

Slide 44 text

PHP is an OOP late bloomer 2007 2015 2011 2003 1999 1995 PHP 5.3 (true OOP) PHP released 1995 PHP 5.2 EOL’ed

Slide 45

Slide 45 text

PHP is an OOP late bloomer 2007 2015 2011 2003 1999 1995 PHP 5.3 (true OOP) PHP released 1995 5.3 50% adoption PHP 5.2 EOL’ed

Slide 46

Slide 46 text

CodeIgniter taught me OOP

Slide 47

Slide 47 text

CodeIgniter taught me OOP some OOP-y things

Slide 48

Slide 48 text

1) Separation of Concerns (MVC)

Slide 49

Slide 49 text

2) Single Responsibility Principle 3) Modules 4) Singletons (Libraries)

Slide 50

Slide 50 text

CodeIgniter libraries are usually just wrappers around a few related functions

Slide 51

Slide 51 text

CodeIgniter Developer != (necessarily) OOP Developer

Slide 52

Slide 52 text

brandon ruined me

Slide 53

Slide 53 text

What OOP isn’t

Slide 54

Slide 54 text

What OOP isn’t Taking all of your old DB- related functions & bundling them into a "model"

Slide 55

Slide 55 text

Taking all of your old functions & bundling them into a "library" What OOP isn’t

Slide 56

Slide 56 text

echo createFullDisplayNameForContactReversed( $prefix, $first_name, $middle_name, $last_name, $suffix, etc.); What OOP isn’t

Slide 57

Slide 57 text

What OOP is

Slide 58

Slide 58 text

What OOP is things that do things to other things thing thing thing

Slide 59

Slide 59 text

Windows:Mac/*nix :: Procedural:OOP

Slide 60

Slide 60 text

Foundations Of OOP

Slide 61

Slide 61 text

Interfaces

Slide 62

Slide 62 text

SOLID

Slide 63

Slide 63 text

SOLID 1. Single Responsibility

Slide 64

Slide 64 text

SOLID 1. Single Responsibility 2. Open-Closed

Slide 65

Slide 65 text

SOLID 1. Single Responsibility 2. Open-Closed 3. Liskov Substitution

Slide 66

Slide 66 text

SOLID 1. Single Responsibility 2. Open-Closed 3. Liskov Substitution 4. Interface Segregation

Slide 67

Slide 67 text

SOLID 1. Single Responsibility 2. Open-Closed 3. Liskov Substitution 4. Interface Segregation 5. Dependency Inversion

Slide 68

Slide 68 text

thing2 thing1 Tight Coupling

Slide 69

Slide 69 text

thing2 thang thing1 Tight Coupling

Slide 70

Slide 70 text

thing2 thing1 injected Off Limits Law of Demeter

Slide 71

Slide 71 text

Why OOP?

Slide 72

Slide 72 text

Sharing & Reuse Why OOP?

Slide 73

Slide 73 text

Lower cost of debug Why OOP?

Slide 74

Slide 74 text

Lower cost of comprehension Why OOP?

Slide 75

Slide 75 text

Limited interfaces Why OOP?

Slide 76

Slide 76 text

Lower cost of change Why OOP?

Slide 77

Slide 77 text

Refactor Time

Slide 78

Slide 78 text

* @param array $contact Contact * @param array $options Options * @return string Full name */ function returnContactFullName( array $contact, $options = array() { // Tack middle name onto first if ($contact['contact_mname'] != '') { $contact['contact_fname'] .= ' ' . $contact['contact_mname']; } if ($contact['contact_sp_mname'] != '') { $contact['contact_sp_fname'] .= ' '.$contact['contact_sp_mname' } ! if ( ! empty($contact['contact_sp_fname']) || ( ! empty($contact[ empty($contact['contact_sp_title']))) { // Contact has a spouse. // Prep title $contact_title = $spouse_title = NULL; ! if ( (empty($contact['contact_title']) && empty($contact['contact_ in_array('no_title', $options) ) { // No titles. Go without. } elseif (empty($contact['contact_sp_title'])) { // Title for contact but not spouse. Only can handle if Mr. if ($contact['contact_title'] == 'Mr' || $contact['contact_ti $contact['contact_sp_title'] = str_replace('Mr', 'Mrs', $co $contact_title = $contact['contact_title'];

Slide 79

Slide 79 text

* * @todo Get this out of the helper * @param array $contact Contact * @param array $options Options * @return string Full name */ function returnContactFullName( array $contact, $options = array() ) { // Tack middle name onto first if ($contact['contact_mname'] != '') { $contact['contact_fname'] .= ' ' . $contact['contact_mname']; } if ($contact['contact_sp_mname'] != '') { $contact['contact_sp_fname'] .= ' '.$contact['contact_sp_mname']; } ! if ( ! empty($contact['contact_sp_fname']) || ( ! empty($contact['contact_title']) && ! empty($contact['contact_sp_title']))) { // Contact has a spouse. // Prep title $contact_title = $spouse_title = NULL; ! if ( (empty($contact['contact_title']) && empty($contact['contact_sp_title'])) || in_array('no_title', $options) ) { // No titles. Go without. } elseif (empty($contact['contact_sp_title'])) { // Title for contact but not spouse. Only can handle if Mr. if ($contact['contact_title'] == 'Mr' || $contact['contact_title'] == 'Mr.') { $contact['contact_sp_title'] = str_replace('Mr', 'Mrs', $contact['contact_title']) $contact_title = $contact['contact_title']; Extract refactor

Slide 80

Slide 80 text

* * @todo Get this out of the helper * @param array $contact Contact * @param array $options Options * @return string Full name */ function returnContactFullName( array $contact, $options = array() ) { // Tack middle name onto first if ($contact['contact_mname'] != '') { $contact['contact_fname'] .= ' ' . $contact['contact_mname']; } if ($contact['contact_sp_mname'] != '') { $contact['contact_sp_fname'] .= ' '.$contact['contact_sp_mname']; } ! if ( ! empty($contact['contact_sp_fname']) || ( ! empty($contact['contact_title']) && ! empty($contact['contact_sp_title']))) { // Contact has a spouse. // Prep title $contact_title = $spouse_title = NULL; ! if ( (empty($contact['contact_title']) && empty($contact['contact_sp_title'])) || in_array('no_title', $options) ) { // No titles. Go without. } elseif (empty($contact['contact_sp_title'])) { // Title for contact but not spouse. Only can handle if Mr. if ($contact['contact_title'] == 'Mr' || $contact['contact_title'] == 'Mr.') { $contact['contact_sp_title'] = str_replace('Mr', 'Mrs', $contact['contact_title']) $contact_title = $contact['contact_title']; Extract refactor $this->appendMiddleNames();

Slide 81

Slide 81 text

* * @todo Get this out of the helper * @param array $contact Contact * @param array $options Options * @return string Full name */ function returnContactFullName( array $contact, $options = array() ) { // Tack middle name onto first if ($contact['contact_mname'] != '') { $contact['contact_fname'] .= ' ' . $contact['contact_mname']; } if ($contact['contact_sp_mname'] != '') { $contact['contact_sp_fname'] .= ' '.$contact['contact_sp_mname']; } ! if ( ! empty($contact['contact_sp_fname']) || ( ! empty($contact['contact_title']) && ! empty($contact['contact_sp_title']))) { // Contact has a spouse. // Prep title $contact_title = $spouse_title = NULL; ! if ( (empty($contact['contact_title']) && empty($contact['contact_sp_title'])) || in_array('no_title', $options) ) { // No titles. Go without. } elseif (empty($contact['contact_sp_title'])) { // Title for contact but not spouse. Only can handle if Mr. if ($contact['contact_title'] == 'Mr' || $contact['contact_title'] == 'Mr.') { $contact['contact_sp_title'] = str_replace('Mr', 'Mrs', $contact['contact_title']) $contact_title = $contact['contact_title']; Extract refactor if ($this->hasSpouse()) { $this->appendMiddleNames();

Slide 82

Slide 82 text

* * @todo Get this out of the helper * @param array $contact Contact * @param array $options Options * @return string Full name */ function returnContactFullName( array $contact, $options = array() ) { // Tack middle name onto first if ($contact['contact_mname'] != '') { $contact['contact_fname'] .= ' ' . $contact['contact_mname']; } if ($contact['contact_sp_mname'] != '') { $contact['contact_sp_fname'] .= ' '.$contact['contact_sp_mname']; } ! if ( ! empty($contact['contact_sp_fname']) || ( ! empty($contact['contact_title']) && ! empty($contact['contact_sp_title']))) { // Contact has a spouse. // Prep title $contact_title = $spouse_title = NULL; ! if ( (empty($contact['contact_title']) && empty($contact['contact_sp_title'])) || in_array('no_title', $options) ) { // No titles. Go without. } elseif (empty($contact['contact_sp_title'])) { // Title for contact but not spouse. Only can handle if Mr. if ($contact['contact_title'] == 'Mr' || $contact['contact_title'] == 'Mr.') { $contact['contact_sp_title'] = str_replace('Mr', 'Mrs', $contact['contact_title']) $contact_title = $contact['contact_title']; Extract refactor if ($this->hasSpouse()) { if ( ! $this->hasTitles()) { $this->appendMiddleNames();

Slide 83

Slide 83 text

* * @todo Get this out of the helper * @param array $contact Contact * @param array $options Options * @return string Full name */ function returnContactFullName( array $contact, $options = array() ) { // Tack middle name onto first if ($contact['contact_mname'] != '') { $contact['contact_fname'] .= ' ' . $contact['contact_mname']; } if ($contact['contact_sp_mname'] != '') { $contact['contact_sp_fname'] .= ' '.$contact['contact_sp_mname']; } ! if ( ! empty($contact['contact_sp_fname']) || ( ! empty($contact['contact_title']) && ! empty($contact['contact_sp_title']))) { // Contact has a spouse. // Prep title $contact_title = $spouse_title = NULL; ! if ( (empty($contact['contact_title']) && empty($contact['contact_sp_title'])) || in_array('no_title', $options) ) { // No titles. Go without. } elseif (empty($contact['contact_sp_title'])) { // Title for contact but not spouse. Only can handle if Mr. if ($contact['contact_title'] == 'Mr' || $contact['contact_title'] == 'Mr.') { $contact['contact_sp_title'] = str_replace('Mr', 'Mrs', $contact['contact_title']) $contact_title = $contact['contact_title']; Extract refactor if ($this->hasSpouse()) { if ( ! $this->hasTitles()) { $this->duplicateSpouseTitleIfNeeded(); $this->appendMiddleNames();

Slide 84

Slide 84 text

contact_array = $contact_array; $this->options = $options; $this->processContactArray(); } ! public function output() { return $this->getFullName(); } ! protected function getFullName() { if ($this->hasSpouse()) { return $this->getFullNameWithSpouse(); } else { return $this->getFullNameIndividual(); } Extract refactor result output(); Example use:

Slide 85

Slide 85 text

Instant Re-use

Slide 86

Slide 86 text

Lone cowboys vs. Jetsons

Slide 87

Slide 87 text

Learn from those who came before you Design Patterns & Coding Standards LESSON 2

Slide 88

Slide 88 text

Design Patterns

Slide 89

Slide 89 text

The Human Brain Identifies Patterns https://www.flickr.com/photos/flamephoenix1991/8376271918/

Slide 90

Slide 90 text

What are Design Patterns?

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

“Gang of Four”

Slide 93

Slide 93 text

Familiar Patterns Module Observer

Slide 94

Slide 94 text

Familiar Patterns (but not by name) Singleton Adapter

Slide 95

Slide 95 text

Not set in stone 23 patterns in “Design Patterns” 13 patterns in “Code Complete” 49 patterns on WIkipedia

Slide 96

Slide 96 text

Standards

Slide 97

Slide 97 text

db ->set('tnt_org_ini', $new_ini)

Slide 98

Slide 98 text

You shouldn’t be able to identify who wrote a piece of code just by looking at it.

Slide 99

Slide 99 text

Sublime Text is not the Sistine Chapel. Consistency over cleverness.

Slide 100

Slide 100 text

def. Standards agreements within any group to adhere to a convention. Benefits: consistency, interoperability, comprehension

Slide 101

Slide 101 text

PSRs (FIG)

Slide 102

Slide 102 text

PSRs (FIG) PSR-0/4: Autoloading

Slide 103

Slide 103 text

PSRs (FIG) PSR-0/4: Autoloading PSR-1 & PSR-2: Coding Standards

Slide 104

Slide 104 text

PSRs (FIG) PSR-0/4: Autoloading PSR-1 & PSR-2: Coding Standards PSR-3: Logger Interface

Slide 105

Slide 105 text

PHPCS http://philsturgeon.co.uk/blog/2013/08/php-static-analysis-in-sublime-text

Slide 106

Slide 106 text

How do I get started?

Slide 107

Slide 107 text

read Gang of Four Head First Design Patterns PHP Objects, Patterns, and Practice Brandon Savage’s “PHP Design Patterns”

Slide 108

Slide 108 text

skim read your old code

Slide 109

Slide 109 text

consider next time you write

Slide 110

Slide 110 text

standardize create internal standards

Slide 111

Slide 111 text

contact_array = $contact_array; $this->options = $options; $this->processContactArray(); } ! public function output() { return $this->getFullName(); } ! protected function getFullName() { if ($this->hasSpouse()) { return $this->getFullNameWithSpouse(); PSR-4 Name Class output(); Example use:

Slide 112

Slide 112 text

Lone cowboys vs. Jetsons

Slide 113

Slide 113 text

Play nice with others Composer, Packagist, & Code Reuse LESSON 3

Slide 114

Slide 114 text

Sharing just got easy

Slide 115

Slide 115 text

What's a Package Manager?

Slide 116

Slide 116 text

History of PHP shareability PEAR PHPScripts.org Composer

Slide 117

Slide 117 text

{ "name": "mattstauffer/peersconf", "description": "PeersConf Demo", "require": { "nesbot/carbon": "1.6.*", "php": ">=5.3.0", "laravel/framework": "4.0.*", "dflydev/markdown": "1.0.*", "iron-io/iron_mq": "1.4.*", "filp/whoops": "1.0.*", "bugsnag/bugsnag": "2.*", "mockery/mockery": "0.*", "psr/log": "1.0.*", "imagine/imagine": "v0.5.0", "iron-io/iron_worker": "1.4.1" }, "autoload": { "psr-0": { "PeersConf": "application/", }, }, "config": { }, "require-dev": { "fzaninotto/Faker": "dev-master", "phpunit/phpunit": "3.7.*" composer.json

Slide 118

Slide 118 text

Next Time You Need a Package/Library

Slide 119

Slide 119 text

No content

Slide 120

Slide 120 text

No content

Slide 121

Slide 121 text

How do I use Composer today?

Slide 122

Slide 122 text

In my CMS... Plugins Dukt & Exp:resso for EE examples Craft: Adrian Macneil “Cocktail Recipes” TD’s Craft Guzzle for wrapping packages

Slide 123

Slide 123 text

In my app... Built into Laravel, Slim, Silex, Yii, Symfony2, ZF2 Can be done in CI

Slide 124

Slide 124 text

A few packages to try out • Guzzle • Twig • Carbon • Monolog

Slide 125

Slide 125 text

Lone cowboys vs. Jetsons

Slide 126

Slide 126 text

Be lazy Delegating to third-party SAAS apps LESSON 4

Slide 127

Slide 127 text

Lone cowboys don’t delegate well.

Slide 128

Slide 128 text

Rails FTW on delegation

Slide 129

Slide 129 text

Karani + PDF PrinceXML $3800 Docraptor $.02-$.08/sheet

Slide 130

Slide 130 text

(also) gridonic/princexml-php

Slide 131

Slide 131 text

The benefits of 3rd party services

Slide 132

Slide 132 text

Limit the requirements of your domain knowledge The benefits of 3rd party services

Slide 133

Slide 133 text

Distribute usefulness to whole company The benefits of 3rd party services

Slide 134

Slide 134 text

Auto-all-the-things The benefits of 3rd party services

Slide 135

Slide 135 text

Consistency The benefits of 3rd party services

Slide 136

Slide 136 text

Worth trying:

Slide 137

Slide 137 text

iron.io

Slide 138

Slide 138 text

mailgun/mandrill/sendgrid

Slide 139

Slide 139 text

bugsnag/getsentry

Slide 140

Slide 140 text

New Relic

Slide 141

Slide 141 text

TravisCI, Coveralls

Slide 142

Slide 142 text

Scrutinizer/Sensio Labs Insights/CodeClimate

Slide 143

Slide 143 text

Lone cowboys vs. Jetsons

Slide 144

Slide 144 text

Cover your butt Testing & TDD LESSON 5

Slide 145

Slide 145 text

You’ve heard you should test…

Slide 146

Slide 146 text

What is (automated software) testing?

Slide 147

Slide 147 text

The Matt Stauffer Authorized Definition Testing: Making sure a piece of code does what it's supposed to, so you can find out if it’s broken*now*, rather than when an angry customer emails you.

Slide 148

Slide 148 text

Benefits of testing

Slide 149

Slide 149 text

1. Catch bugs in dev

Slide 150

Slide 150 text

2. Refactor with Confidence

Slide 151

Slide 151 text

simple_john_doe, array()); ! $this->assertEquals($output_name, $name->output()); } ! public function testHandlesSimpleIndividualReversed() { $output_name = 'Doe, John'; ! $name = new Name($this->simple_john_doe, array('reversed')); ! $this->assertEquals($output_name, $name->output()); } ! public function testHandlesDecoratedIndividual() { $output_name = 'Dr. John Edward Doe MD'; ! $name = new Name($this->decorated_john_doe, array());

Slide 152

Slide 152 text

"What a pain to go back and write all those tests"

Slide 153

Slide 153 text

What is TDD?

Slide 154

Slide 154 text

TDD != testing

Slide 155

Slide 155 text

Red Green Refactor

Slide 156

Slide 156 text

[red example]

Slide 157

Slide 157 text

No content

Slide 158

Slide 158 text

How do I get started with testing?

Slide 159

Slide 159 text

1. PHPUnit

Slide 160

Slide 160 text

2. Write tests for all bug fixes

Slide 161

Slide 161 text

3. Write tests for all new code

Slide 162

Slide 162 text

4. Stick with just unit tests for now

Slide 163

Slide 163 text

How do I get started in my environment?

Slide 164

Slide 164 text

Laravel: Built in

Slide 165

Slide 165 text

Craft: Built in (check out adrian macneil)

Slide 166

Slide 166 text

CodeIgniter: It can be done https://bitbucket.org/kenjis/my-ciunit

Slide 167

Slide 167 text

ExpressionEngine: It can be done, ish Stephen Lewis & Testee

Slide 168

Slide 168 text

Lone cowboys vs. Jetsons

Slide 169

Slide 169 text

No content

Slide 170

Slide 170 text

Outro

Slide 171

Slide 171 text

Recap

Slide 172

Slide 172 text

Recap 1. Embrace the object

Slide 173

Slide 173 text

Recap 1. Embrace the object 2. Learn from those who came before you

Slide 174

Slide 174 text

Recap 1. Embrace the object 2. Learn from those who came before you 3. Play nice with others

Slide 175

Slide 175 text

Recap 1. Embrace the object 2. Learn from those who came before you 3. Play nice with others 4. Be lazy

Slide 176

Slide 176 text

Recap 1. Embrace the object 2. Learn from those who came before you 3. Play nice with others 4. Be lazy 5. Cover your butt

Slide 177

Slide 177 text

Advanced stuff

Slide 178

Slide 178 text

Exceptions

Slide 179

Slide 179 text

HHVM

Slide 180

Slide 180 text

Hack

Slide 181

Slide 181 text

Vagrant

Slide 182

Slide 182 text

Gitflow & PRs

Slide 183

Slide 183 text

Chef/Puppet/ Capistrano/Envoy

Slide 184

Slide 184 text

IRC (party like it’s 1999)

Slide 185

Slide 185 text

PHP 5.4 built in php server traits short array syntax function array dereferencing

Slide 186

Slide 186 text

PHP 5.5 generators try/catch/finally foreach(list) expressions as empty() args Array/string dereferencing classname via ::class (alias get_class)

Slide 187

Slide 187 text

PHP 5.6 Variadic functions Argument unpacking Constants assigned to expressions Import namespaced functions

Slide 188

Slide 188 text

No content

Slide 189

Slide 189 text

No content

Slide 190

Slide 190 text

No content

Slide 191

Slide 191 text

Follow the FIG

Slide 192

Slide 192 text

One Final Note This is not what you “should do” because it’s nice. ! This is what you “should do” because if you do it your life will be better and you will make more money.

Slide 193

Slide 193 text

Writing modular, reusable code. Not reinventing the wheel. No lone cowboys. Learning from our peers & predecessors. Finding the bugs before the clients do. Having confidence to make changes in the future. Reducing code rot & technical debt. Making life easier. Thanks. @stauffermatt