SlideShare a Scribd company logo
1 of 19
Download to read offline
YOUR (CODING) STANDARDS
MATTER
ABOUT ME
Software Engineer
PHP since 11 years
CI
CleanCode
DevOps
TDD
Shipping
Bullet points
WORKING FOR
ResearchGate gives science back to the people who make it happen.
We help researchers build reputation and accelerate scientific
progress.
On their terms.
GET IN TOUCH
stackoverflow:
Twitter: @_ _edorian
G+ / Xing: Volker Dusch
IRC (freenode): edorian
Mail: php@wallbash.com
WHY I AM HERE TODAY
SO WHAT IS THIS TALK ABOUT?
PHP!
CODING GUIDELINES!
THE TOOLS
PHP MESSDETECTOR
Complexity, long term maintainability, keeps you honest when
designing
PHP CODE SNIFFER
Code formatting, simple coding errors, helps you stay consistent in a
team
PURPOSE (IMHO)
PHPMD is for naming, size, complexity and all the hard to change
things
PHPCS is for whitespace and all the things that are easy to fix
HOW TO MAKE USE OF THEM
Configure rules that match the way you are working!
It's easier than it feels!
WHAT ABOUT STANDARDS?
PHPMD: Use all the rules, they are reasonable. Configure them later
PHPCS: Use PSR2. Replace things if they don't work for your team
INSTALLING
{
"require": {
"squizlabs/php_codesniffer": "*",
"phpmd/phpmd": "*"
},
"config": {
"bin-dir": "/usr/local/bin/"
}
}
DEMO
Let's create ruleset files for both of the tools :)
http://edorian.github.io/php-coding-standard-generator/#phpmd
COMMANDS USED
Use most of PHPMDs rules:
Use your custom ruleset:
Use PSR2 with PHPCS:
Use your own PHPCS rules:
phpmd source text codesize,unusedcode,naming,design
phpmd source text phpmd.xml
phpcs --standard=PSR2 source/
phpcs --standard=phpcs.xml source/
CONTINUOUS INTEGRATION
Real world usage along a projects lifecylce
Pretty graphs in Jenkins!
Fail your travis ci build on phpcs errors?
Fail your travis ci build on phpmd errors???
THANK YOU!
QUESTIONS?
GET IN TOUCH
stackoverflow:
Twitter: @_ _edorian
G+ / Xing: Volker Dusch
IRC (freenode): edorian
Mail: php@wallbash.com
Your (coding) standards matter

More Related Content

Viewers also liked

Ethan Albert Native American Project for Mr. Morgan
Ethan Albert Native American Project for Mr. MorganEthan Albert Native American Project for Mr. Morgan
Ethan Albert Native American Project for Mr. Morgan
Harmony Elementary
 
презентация1
презентация1презентация1
презентация1
yolkina548
 
National Geographic2
National Geographic2National Geographic2
National Geographic2
guest707d8f1
 
Nginx The webserver you might actually like
Nginx   The webserver you might actually likeNginx   The webserver you might actually like
Nginx The webserver you might actually like
Edorian
 

Viewers also liked (20)

Harrison d.
Harrison d.Harrison d.
Harrison d.
 
Ethan Albert Native American Project for Mr. Morgan
Ethan Albert Native American Project for Mr. MorganEthan Albert Native American Project for Mr. Morgan
Ethan Albert Native American Project for Mr. Morgan
 
MANO
MANOMANO
MANO
 
Shoham main projects 2010
Shoham main projects 2010Shoham main projects 2010
Shoham main projects 2010
 
презентация1
презентация1презентация1
презентация1
 
Lucius M
Lucius MLucius M
Lucius M
 
National Geographic2
National Geographic2National Geographic2
National Geographic2
 
Energy Overview No Video Small
Energy Overview No Video   SmallEnergy Overview No Video   Small
Energy Overview No Video Small
 
Independent auto & home
Independent auto & homeIndependent auto & home
Independent auto & home
 
Nginx The webserver you might actually like
Nginx   The webserver you might actually likeNginx   The webserver you might actually like
Nginx The webserver you might actually like
 
Sydney h
Sydney hSydney h
Sydney h
 
Enfermedad de chagas
Enfermedad de chagasEnfermedad de chagas
Enfermedad de chagas
 
MANO
MANOMANO
MANO
 
Independent auto & home
Independent auto & homeIndependent auto & home
Independent auto & home
 
Field Studies Council anticipates savings of up to £100,000 per annum with do...
Field Studies Council anticipates savings of up to £100,000 per annum with do...Field Studies Council anticipates savings of up to £100,000 per annum with do...
Field Studies Council anticipates savings of up to £100,000 per annum with do...
 
Chase A
Chase AChase A
Chase A
 
Mit pune e prospectus
Mit pune e prospectusMit pune e prospectus
Mit pune e prospectus
 
Tristan.d
Tristan.dTristan.d
Tristan.d
 
Food Rules
Food RulesFood Rules
Food Rules
 
The Good/Bad of Power Point
The Good/Bad of Power PointThe Good/Bad of Power Point
The Good/Bad of Power Point
 

Similar to Your (coding) standards matter

Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief example
Jeremy Kendall
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principles
Edorian
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
Svetlin Nakov
 
Introduction to DevOps slides-converted (1).pptx
Introduction to DevOps slides-converted (1).pptxIntroduction to DevOps slides-converted (1).pptx
Introduction to DevOps slides-converted (1).pptx
aasssss1
 
How To Do A Project?
How To Do A Project?How To Do A Project?
How To Do A Project?
Aravinth NSP
 

Similar to Your (coding) standards matter (20)

Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief example
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
DevEx Essentials
DevEx EssentialsDevEx Essentials
DevEx Essentials
 
ALTNET
ALTNETALTNET
ALTNET
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principles
 
Practical DevOps
Practical DevOpsPractical DevOps
Practical DevOps
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
Refactoring 2 The Max
Refactoring 2 The MaxRefactoring 2 The Max
Refactoring 2 The Max
 
Introduction to PHP (SDPHP)
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)
 
Infochimps: How We Do It
Infochimps: How We Do ItInfochimps: How We Do It
Infochimps: How We Do It
 
Code Retreat
Code RetreatCode Retreat
Code Retreat
 
Introduction to DevOps slides-converted (1).pptx
Introduction to DevOps slides-converted (1).pptxIntroduction to DevOps slides-converted (1).pptx
Introduction to DevOps slides-converted (1).pptx
 
How To Do A Project
How To Do A ProjectHow To Do A Project
How To Do A Project
 
How To Do A Project?
How To Do A Project?How To Do A Project?
How To Do A Project?
 
A sweet taste of clean code and software design
A sweet taste of clean code and software designA sweet taste of clean code and software design
A sweet taste of clean code and software design
 
DEVOPS COURSE PDF.pdf
DEVOPS COURSE PDF.pdfDEVOPS COURSE PDF.pdf
DEVOPS COURSE PDF.pdf
 
How to Choose an IDE for Data Science (1).pdf
How to Choose an IDE for Data Science (1).pdfHow to Choose an IDE for Data Science (1).pdf
How to Choose an IDE for Data Science (1).pdf
 
Xp Slideshow
Xp SlideshowXp Slideshow
Xp Slideshow
 
Agile == Dynamic?
Agile == Dynamic?Agile == Dynamic?
Agile == Dynamic?
 

More from Edorian

More from Edorian (11)

Nginx - The webserver you might actually like
Nginx - The webserver you might actually likeNginx - The webserver you might actually like
Nginx - The webserver you might actually like
 
Code review in practice
Code review in practiceCode review in practice
Code review in practice
 
PhpUnit Best Practices
PhpUnit Best PracticesPhpUnit Best Practices
PhpUnit Best Practices
 
Nginx & php fpm - the webserver you might actually like - php usergroup berlin
Nginx & php fpm - the webserver you might actually like - php usergroup berlinNginx & php fpm - the webserver you might actually like - php usergroup berlin
Nginx & php fpm - the webserver you might actually like - php usergroup berlin
 
Clean code is not the goal - working software is
Clean code is not the goal - working software isClean code is not the goal - working software is
Clean code is not the goal - working software is
 
The state of PHPUnit
The state of PHPUnitThe state of PHPUnit
The state of PHPUnit
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
 
Stop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principlesStop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principles
 
php unconference Europa: Clean code - Stop wasting my time
php unconference Europa: Clean code - Stop wasting my timephp unconference Europa: Clean code - Stop wasting my time
php unconference Europa: Clean code - Stop wasting my time
 
Clean Code: Stop wasting my time
Clean Code: Stop wasting my timeClean Code: Stop wasting my time
Clean Code: Stop wasting my time
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Your (coding) standards matter