Be ¡a ¡Bold ¡Coder ¡ Beth ¡Tucker ¡Long ¡ @e3betht ¡
Who ¡am ¡I? ¡ Beth ¡Tucker ¡Long ¡ ¡ ¡(@e3betht) ¡ • PHP ¡Developer ¡at ¡ ¡ Code ¡Climate ¡ • Stay-‑at-‑home ¡mom ¡ • User ¡group ¡leader ¡ • Mentor ¡ ¡ ¡ @e3betht
Audience ¡ParIcipaIon? ¡ • Completely ¡fine. ¡Ask ¡me ¡quesIons ¡any ¡Ime. ¡ @e3betht
Why? ¡ @e3betht
Why? ¡ • Build ¡confidence ¡ • Improve ¡code ¡quality ¡and ¡security ¡ • Easier ¡integraIon ¡ @e3betht
¡ What ¡this ¡talk ¡is ¡not ¡ ¡ @e3betht
A ¡bit ¡of ¡history ¡ ¡ ¡ @e3betht
Use ¡the ¡"S" ¡Word ¡ @e3betht
Use ¡the ¡"S" ¡Word ¡ Standards! ¡ @e3betht
Use ¡the ¡"S" ¡Word ¡ Wait, ¡mulIple ¡standards? ¡ @e3betht
PHP-‑FIG ¡ • PSR-‑1 ¡Basic ¡Coding ¡Standard ¡ hVp://www.php-‑fig.org/psr/psr-‑1/ ¡ ¡ ¡ • PSR-‑2 ¡Coding ¡Style ¡Standard ¡ hVp://www.php-‑fig.org/psr/psr-‑2/ ¡ ¡ @e3betht
PHP ¡Coding ¡Standards ¡Fixer ¡ hVp://cs.sensiolabs.org ¡ ¡ • Fixes ¡"most" ¡issues ¡ • PSR-‑1 ¡and ¡PSR-‑2 ¡compliant ¡ @e3betht
PHP_CodeSniffer ¡ hVps://github.com/squizlabs/PHP_CodeSniffer ¡ ¡ ¡ ¡ • Phar, ¡PEAR, ¡or ¡Composer ¡ • Preset ¡and ¡customizable ¡standards ¡ • Will ¡fix ¡items ¡for ¡you ¡automaIcally ¡ @e3betht
Output ¡ $ ¡phpcs ¡/myDir/myFile.php ¡ FILE: ¡/myDir/myFile.php ¡ -‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑ ¡ FOUND ¡3 ¡ERROR(S) ¡AFFECTING ¡3 ¡LINE(S) ¡ -‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑ ¡ ¡ ¡2 ¡ ¡| ¡ERROR ¡| ¡[ ¡ ¡] ¡Missing ¡file ¡doc ¡comment ¡ ¡20 ¡| ¡ERROR ¡| ¡[x] ¡PHP ¡keywords ¡must ¡be ¡lowercase; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡expected ¡"false" ¡but ¡found ¡"FALSE" ¡ ¡47 ¡| ¡ERROR ¡| ¡[x] ¡Line ¡not ¡indented ¡correctly; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡expected ¡4 ¡spaces ¡but ¡found ¡1 ¡ -‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑-‑ ¡ @e3betht
IDEs ¡ • Sublime ¡Text ¡ hVp://www.sublimetext.com ¡ ¡ ¡ • PhpStorm ¡ hVps://www.jetbrains.com/phpstorm/ ¡ ¡ • Vim ¡ hVp://www.vim.org ¡ ¡ @e3betht
Use ¡the ¡other ¡"S" ¡Word ¡ @e3betht
Use ¡the ¡other ¡"S" ¡Word ¡ ¡ Security ¡ @e3betht
Security ¡ • hVp://php.net/manual/en/security.php ¡ • hVps://www.owasp.org/index.php/ PHP_Security_Cheat_Sheet ¡ • hVp://websec.io ¡ ¡ ¡ • Securing ¡PHP: ¡Core ¡Concepts ¡ hVps://leanpub.com/securingphp-‑coreconcepts ¡ hVps://speakerdeck.com/ccornuV ¡ ¡ hVp://securingphp.com ¡ ¡ @e3betht
Test ¡Your ¡Code ¡ A ¡liVle ¡bit ¡of ¡extra ¡work ¡up ¡front ¡ saves ¡lots ¡and ¡lots ¡of ¡work ¡later ¡on. ¡ @e3betht
Need ¡Help ¡with ¡TesIng? ¡ Chris ¡Hartjes ¡ ¡ @grmpyprogrammer ¡ ¡ hVp://grumpy-‑learning.com ¡ ¡ @e3betht
Use ¡a ¡TesIng ¡Framework ¡ PHPUnit ¡ hVps://phpunit.de ¡ ¡ @e3betht
Document ¡Your ¡Code ¡ Make ¡sure ¡everyone ¡knows ¡ ¡ what ¡your ¡code ¡is ¡doing… ¡ ¡ including ¡you. ¡ @e3betht
Document ¡Your ¡Code ¡ phpDocumentor: ¡hVp://www.phpdoc.org/ ¡ ¡ ¡ ¡ • Automates ¡documentaIon ¡ ¡ • Tutorial: ¡ hVp://manual.phpdoc.org/HTMLSmartyConverter/ HandS/phpDocumentor/ tutorial_phpDocumentor.howto.pkg.html ¡ ¡ @e3betht
/** ¡ ¡ ¡* ¡Put ¡your ¡short ¡descripIon ¡here. ¡ ¡ ¡* ¡ ¡ ¡ ¡* ¡Put ¡your ¡long ¡descripIon ¡here. ¡ ¡ ¡ ¡* ¡You ¡may ¡use ¡mulIple ¡lines. ¡ ¡ ¡* ¡You ¡can ¡even ¡use ¡Markdown. ¡ ¡ ¡* ¡ ¡ ¡* ¡@author ¡ ¡Beth ¡Tucker ¡Long ¡<beth@musketeers.me> ¡ ¡ ¡* ¡ ¡ ¡* ¡@since ¡1.0 ¡ ¡ ¡* ¡ ¡ ¡ ¡* ¡@param ¡int ¡$exampleA ¡ ¡This ¡is ¡a ¡method ¡parameter ¡descripIon. ¡ ¡ ¡* ¡@param ¡string ¡$exampleB ¡This ¡is ¡another ¡example. ¡ ¡ ¡ ¡*/ ¡ @e3betht
¡ ¡ @e3betht
Know ¡Your ¡Language ¡ php.net ¡ @e3betht
¡ ¡ @e3betht
¡ ¡ @e3betht
¡ ¡ @e3betht
¡ ¡ @e3betht
Know ¡Your ¡Framework/Library ¡ hVps://github.com/ ¡ ¡ @e3betht
Know ¡Your ¡Framework/Library ¡ hVps://github.com/ ¡ Contribute! ¡ @e3betht
Checking ¡Code ¡ Sensio ¡Insight ¡ hVps://insight.sensiolabs.com/ ¡ ¡ • Free ¡for ¡open ¡source ¡ • Integrated ¡with ¡Git ¡ • Symfony-‑focused, ¡but ¡works ¡with ¡any ¡PHP ¡ code ¡ • Checks ¡PHP, ¡XML, ¡YAML, ¡Twig ¡templates, ¡ and ¡Composer ¡dependencies ¡ @e3betht
Checking ¡Code ¡ ScruInizer ¡ hVps://scruInizer-‑ci.com/ ¡ ¡ • Free ¡for ¡open ¡source ¡ • Integrated ¡with ¡Git ¡ • Integrates ¡open ¡source ¡ checking ¡tools ¡like ¡ PHP_CodeSniffer ¡and ¡PHP ¡ Mess ¡Detector ¡ ¡ • Checks ¡PHP, ¡Python, ¡and ¡ Ruby ¡ @e3betht
Checking ¡Code ¡ Code ¡Climate ¡ hVps://codeclimate.com/ ¡ ¡ • Free ¡for ¡open ¡source ¡ • Integrated ¡with ¡Git ¡ • Very ¡fast ¡ • Checks ¡PHP, ¡JS, ¡Ruby, ¡and ¡ coming ¡soon ¡-‑ ¡Python ¡ • Takes ¡security ¡seriously: ¡ codeclimate.com/security ¡ ¡ @e3betht
Never ¡ Stop ¡ ¡ ¡ Learning ¡ @e3betht
Learn ¡by ¡Reading ¡ hVp://www.phparch.com/magazine/ ¡ ¡ ¡ ¡ hVp://www.phptherightway.com ¡ ¡ ¡ hVp://phpdeveloper.org ¡ ¡ ¡ ¡ ¡ @e3betht
Learn ¡by ¡Reading ¡ hVps://leanpub.com ¡ ¡ ¡ Amazon ¡ ¡ Your ¡local ¡library ¡ ¡ ¡ ¡ @e3betht
Learn ¡by ¡Watching ¡ hVp://nomadphp.com ¡ ¡ hVps://www.youtube.com/user/phpukconference ¡ hVps://www.youtube.com/user/phpacademy/ ¡ ¡ hVp://www.pluralsight.com/ ¡ hVps://www.youtube.com/user/LevelUpTuts ¡ ¡ @e3betht ¡
Learn ¡by ¡InstrucIon ¡ hVp://www.phparch.com/training/ ¡ ¡ hVp://www.zend.com/services/training ¡ ¡ hVp://www.codecademy.com/en/tracks/php ¡ ¡ ¡ ¡ @e3betht ¡
Learn ¡by ¡Listening ¡ hVp://devhell.info ¡ ¡ hVp://looselycoupled.info ¡ ¡ hVp://phptownhall.com ¡ ¡ hVp://thatpodcast.io ¡ ¡ ¡ ¡ ¡ @e3betht
Learn ¡by ¡PracIcing ¡ hVps://laracasts.com/series/code-‑katas-‑in-‑php ¡ ¡ hVp://codingdojo.org/cgi-‑bin/index.pl? KataCatalogue ¡ ¡ hVp://phpcodepad.com ¡ ¡ ¡ @e3betht
Learn ¡by ¡Email ¡ hVp://securingphp.com ¡ ¡ hVp://www.phpweekly.com ¡ ¡ @e3betht
Learn ¡by ¡Hanging ¡Out ¡ Freenode ¡ ¡ hVps://webchat.freenode.net ¡ ¡ ¡ #phpc ¡ #phpwomen ¡ #phpmentoring ¡ @e3betht
Learn ¡by… ¡ @e3betht
Learn ¡by… ¡ Mentoring ¡ @e3betht
Find ¡a ¡Mentor ¡ hVp://phpmentoring.org ¡ ¡ hVp://www.slideshare.net ¡ hVp://www.joind.in ¡ hVp://php.net/conferences/ ¡ hVp://nocapes.net ¡ ¡ hVp://voicesotheelephpant.com ¡ ¡ ¡ ¡ @e3betht
Recommend
More recommend