My colleague Mike Zaschka and I talking about how tools like PHP Mess Detection, Copy & Paste Detection and CodeSniffer can help you gaining better software quality in TYPO3 extensions.
2nd October 2010, TYPO3 Conference Frankfurt
Full-day tutorial for the dutch php conference 2011 giving a very quick tour around all the various areas of the ZCE syllabus and some tips on the exam styles
Correctly understanding the eight data types in PHP is essential to a solid foundation in development. Come refresh your knowledge of the scalar types, compound types, and special data types used in PHP, and learn about proper usage of each. Review type juggling, learn some common data type traps to avoid, and how to code defensively to prevent having the data type of a variable change unexpectedly. Finally learn how unit tests can help verify that code is handling data types correctly.
There are lots of resources that explain how to create a Custom Post Type, but few go into detail on how to display. This presentation does both, all from a Designer's perspective.
Full-day tutorial for the dutch php conference 2011 giving a very quick tour around all the various areas of the ZCE syllabus and some tips on the exam styles
Correctly understanding the eight data types in PHP is essential to a solid foundation in development. Come refresh your knowledge of the scalar types, compound types, and special data types used in PHP, and learn about proper usage of each. Review type juggling, learn some common data type traps to avoid, and how to code defensively to prevent having the data type of a variable change unexpectedly. Finally learn how unit tests can help verify that code is handling data types correctly.
There are lots of resources that explain how to create a Custom Post Type, but few go into detail on how to display. This presentation does both, all from a Designer's perspective.
For PHP developer who have begun to use OOP and are looking to take things to the next left. We talk about some more complex topics, about moving beyond inheritance, some of the PHP SPL and a couple of patterns that get you thinking about how to really start utilizing OOP in PHP the right way.
Convention Generator - Yi’s Eclipse Monkey Scripts for Coding ActionScript in...Yi Tan
This is a handy Eclipse Monkey script generates ActionScript code templates by conventions.
Host on Google code:
http://code.google.com/p/yis-eclipse-monkey-scripts-for-flash-builder/
TWIG: the flexible, fast and secure template language for PHPCesare D'Amico
TWIG is a template engine created by Fabien Potencier, the father of Symfony. In this talk you'll learn why he wrote it, its main features and strengths.
With this presentation I hope to show that using SPL doesn't require a PHD and that it really benefits your application design, maintainability and implements best practices to solve common development problems.
The most hated thing a developer can imageine is writing documentation but on the other hand nothing can compare with a well documented source code if you want to change or extend some code. PhpDocumentor is one of many tools enabling you to parse the inline documentation and generate well structured and referenced documents. This tallk will show you how to get the most out of phpDocumentor and shall enable you to write fantastic documentation.
From ReactPHP to Facebook Hack's Async implementation and many more, asynchronous programming has been a 'hot' topic lately. But how well does async programming support work in PHP and what can you actually use it for in your projects ? Let's look at some real-world use cases and how they leverage the power of async to do things you didn't know PHP could do.
The most hated thing a developer can imagine is writing documentation but on the other hand nothing can compare with a well documented source code if you want to change or extend some code. PhpDocumentor is one of many tools enabling you to parse the inline documentation and generate well structured and referenced documents. This tallk will show you how to get the most out of phpDocumentor and shall enable you to write fantastic documentation.
Slides from the According Talk at the T3CON12 in Québec City, Canada.
The talk presented an overview on how the decision to have 6.0 was made, what this means to the user, the schedule and goals for TYPO3 6.0 as well as contact information to getting hands dirty on this project.
For PHP developer who have begun to use OOP and are looking to take things to the next left. We talk about some more complex topics, about moving beyond inheritance, some of the PHP SPL and a couple of patterns that get you thinking about how to really start utilizing OOP in PHP the right way.
Convention Generator - Yi’s Eclipse Monkey Scripts for Coding ActionScript in...Yi Tan
This is a handy Eclipse Monkey script generates ActionScript code templates by conventions.
Host on Google code:
http://code.google.com/p/yis-eclipse-monkey-scripts-for-flash-builder/
TWIG: the flexible, fast and secure template language for PHPCesare D'Amico
TWIG is a template engine created by Fabien Potencier, the father of Symfony. In this talk you'll learn why he wrote it, its main features and strengths.
With this presentation I hope to show that using SPL doesn't require a PHD and that it really benefits your application design, maintainability and implements best practices to solve common development problems.
The most hated thing a developer can imageine is writing documentation but on the other hand nothing can compare with a well documented source code if you want to change or extend some code. PhpDocumentor is one of many tools enabling you to parse the inline documentation and generate well structured and referenced documents. This tallk will show you how to get the most out of phpDocumentor and shall enable you to write fantastic documentation.
From ReactPHP to Facebook Hack's Async implementation and many more, asynchronous programming has been a 'hot' topic lately. But how well does async programming support work in PHP and what can you actually use it for in your projects ? Let's look at some real-world use cases and how they leverage the power of async to do things you didn't know PHP could do.
The most hated thing a developer can imagine is writing documentation but on the other hand nothing can compare with a well documented source code if you want to change or extend some code. PhpDocumentor is one of many tools enabling you to parse the inline documentation and generate well structured and referenced documents. This tallk will show you how to get the most out of phpDocumentor and shall enable you to write fantastic documentation.
Slides from the According Talk at the T3CON12 in Québec City, Canada.
The talk presented an overview on how the decision to have 6.0 was made, what this means to the user, the schedule and goals for TYPO3 6.0 as well as contact information to getting hands dirty on this project.
The Avid Life Media hack is a striking example of everything that can go wrong when a company is completely breached followed by a total disclosure of the stolen information. This attack resulted in an estimated $200 million in costs, firing of the CEO, and countless lives ruined. This presentation will review the data exposed and what can be learned to prevent this from happening to your organization.
By end of 2016, a majority of enterprise mailboxes will be Cloud-based, however organization are not ready to go all-in the Cloud.
As an IT administrator, people rely on your capability to deliver Microsoft Hybrid services and keep them running optimally to maximize workers’ productivity. Benefit from a unified set of tools to manage messaging performance is key to provide you with a better control of your critical informations.
Check this presentation and see how the pairing up of GSX Solutions and CodeTwo can help you:
- Ensure better Quality of Service On-premises & in the Cloud
- Streamline your mailbox backup with automatic and centralized backups
- Reduce your MTTR to ensure optimal performance for your business lines
- Meet SLA’s and ensure strong governance for Exchange platforms
Practical tips for dealing with projects involving legacy code. Covers investigating past projects, static analysis of existing code, and methods for changing legacy code.
Presented at PHP Benelux '10
TYPO3 Extension development using new Extbase frameworkChristian Trabold
My presentation for the TYPO3 community day in Tokyo, Japan.
The code is available at https://github.com/ctrabold/t3ski-workshop.
Due to copyright issues I had to remove all pictures of Miffy.
This DrupalCon 2019 Amsterdam talk provides a look beyond the world of PHP and Javascript. It explores how other languages such as Ruby, Java, Rust and Perl handle things and highlights some interesting features of those languages. Not all the things that other languages can do can be done in PHP or Javascript but the concepts and ideas can still be used.
FLOW3 1.0 – scheduled for the 2nd quarter of 2011 – is an application framework aiming to back up developers with security and infrastructure while they focus on the application logic. With Domain-Driven Design as its major underlying concept, FLOW3 is easy to learn but flexible enough for complex projects.
This session from the International PHP Conference 2011 (Spring) provides a comprehensive overview of the main strengths of FLOW3.
This presentation discusses the most neglected quality axis : code documentation. See good and bad examples, best practices on documenting code and why you should try not to ignore it :)
Presentation date: 2014-11-28
Place: Thessaloniki Java Meetup Group (SKG)
Given at TechMaine's Java Users Group on Feb 26 2008
Why do we need another build tool when we already have Ant? By focusing on convention over configuration, Maven allows you to declaratively define how your project is built, which reduces a lot of the procedural code that you'd need to implement in every build file if you were using Ant. This, along with Maven's built-in management of repositories for project dependencies, allows you to streamline your build process. Ultimately Maven can reduce the amount of time that would otherwise be wasted hunting down jar files and fiddling with boilerplate build scripts.
This presentation covers Maven's core concepts. It introduces the Plugin architecture, and explain how the most popular plugins are used. It also covers the POM concept and how it relates to dependency tracking and repositories.
Build powerfull and smart web applications with Symfony2Hugo Hamon
Symfony2 first stable release is scheduled for the first week of March 2011. During this session, we will have a look at the new framework architecture and most of its powerfull features.
We will show you how Symfony2 implements the MVC pattern and an HTTP request is processed and converted as a response for the end user. Of course, we will talk about the configuration principles and how it's easy to configure Symfony2 project parts like the routing system or the data model. We will also focus on other major components of the framework like the Doctrine2 integration, forms, security (authentication and authorizations) or HTTP cache management.
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
Let us spend less time writing trivial stuff and more time focusing on great code that doesn't need documentation to be understood.
Save other peoples time by writing less !
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
Similar to How to improve the quality of your TYPO3 extensions (20)
This talk will introduce tools to measure and improve quality of TYPO3's infrastructure.
You will get an overview on how serious TYPO3 takes Quality Assurance
in TYPO3's source code and the infrastructure.
Introducing the TYPO3 projects pear.typo3.org, ci.typo3.org and metrics.typo3.org
Talk about lessons we learned and what's the Roadmap for improving TYPO3 Core and TER quality.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
How to improve the quality of your TYPO3 extensions
1. How to improve
the quality of your
TYPO3 extensions
Christian Trabold
Mike Zaschka
2nd October 2010, TYPO3 Conference Frankfurt
2. Agenda
What‘s the problem?
High speed code reviews
Tools that help you
Questions & Answers
3. Dowloads & Feedback
We provide links and further information on
http://bit.ly/t3con10-qatalk
We are listening to you on twitter
#t3con10-qatalk
Ask!
It‘s okay to ask after each chapter and after the talk :)
The installation instructions are available in our
paper
5. About us
Christian Trabold
Senior Developer
Web since 1999
TYPO3 since 2004
dkd since 2006
Focus on quality assurance
Author of TYPO3 Kochbuch, O‘Reilly
E-Mail christian.trabold@dkd.de
Twitter @ctrabold
6. About us
Mike Zaschka
Senior Developer
TYPO3 since 2005
Ruby/Rails since 2007
dkd since 2008
eMail mike.zaschka@dkd.de
Twitter @mike_zaschka
17. "Most of the time you sit
next to a hairy, unfriendly
colleage and argue about
line indentions..."
Mike
http://www.flickr.com/photos/octopushat/403730001/
18. And after a while
you don't see code anymore!
class Example {{
class Example {
class Example
private static $ID == 1;
private static $ID = 1;
private $title ==$ID
private static "t3con";
1;
private $title = "t3con";
private $title "t3con";
/*
/*
/*
// Some code II don't want to delete
// Some code I don't want to delete
// Some code don't want to delete
public function addNothing($content) {{
public function addNothing($content) {
public function addNothing($content)
$content == "";
$content = "";
$content "";
return $content;
return $content;
}} return $content;
*/}
*/
*/
public function addYear($year) {{
public function addYear($year) {
public function addYear($year)
return $this->title .. "" 2010";
return $this->title . " 2010";
return $this->title 2010";
}}
}} }
}
19. Downsides of code reviews
You have to search for errors
You have no time
Most of the time you discuss less important
things
No sharing of knowledge
I hate my colleagues syndrome
Do code reviews really ensure quality?
20. Manual code reviews can cause serious
damage to your nerves!
You might nd your colleagues
dead in front of the computer!
None of our developers was harmed for this presentation!
http://www.flickr.com/photos/jakub_hlavaty/2164581030/
21. Wouldn‘t it be nice...
If a code review could be automated?
If I could see the aws before I review?
Is it a dream or could it be reality?
24. Use PHP Mess Detector
Use it on your console like this:
$ phpmd . text codesize,unusedcode,naming
Report
format Rulesets
Source
path
25. Example code
class Example {
private static $ID = 1;
private $title = "t3con";
/* An unused method */
private function addNothing($content) {
$content = "";
return $content;
}
public function addYear($year) {
return $this->title . " 2010";
}
public function add_year_2010($year) {
return $this->title . " 2010";
}
}
26. Detecting the mess
$ phpmd example.php text codesize,unusedcode,naming
example.php:4 Avoid unused private fields such as '$ID'.
example.php:4 Avoid variables with short names like $ID
example.php:8 Avoid unused private methods such as 'addNothing'.
example.php:13 Avoid unused parameters such as '$year'.
example.php:17 Avoid unused parameters such as '$year'.
27. Fixing the code
class Example {
private static $ID = 1; // Not used / too short
private $title = "t3con";
/* An unused method */
private function addNothing($content) { // Not used
$content = "";
return $content;
}
public function addYear($year) { // Not used
return $this->title . " 2010";
}
public function add_year_2010($year) { // Not used
return $this->title . " 2010";
}
}
28. Fixing the code
class Example {
private $title = "t3con";
public function addYear() {
return $this->title . " 2010";
}
public function add_year_2010() {
return $this->title . " 2010";
}
}
30. Duplicate code is not
a little something!
Unnecessary complexity
Issues in architecture
Hard maintainable code
Multiple changes
Error prone
31. Back to the example code
class Example {
private $title = "t3con";
public function addYear() {
return $this->title . " 2010";
}
public function add_year_2010() {
return $this->title . " 2010";
}
}
32. Detecting duplicate code
You use it on your console like this:
$ phpcpd example.php
Found 1 exact clones with 2 duplicated
lines in 1 files:
- example.php:5-6
example.php:9-10
33. Fixing the code
class Example {
private $title = "t3con";
public function addYear() {
return $this->title . " 2010"; // Duplicate code
}
public function add_year_2010() {
return $this->title . " 2010"; // Duplicate code
}
}
34. Fixing the code
class Example {
private $title = "t3con";
public function addYear() {
return $this->add_year_2010();
}
public function add_year_2010() {
return $this->title . " 2010";
}
}
36. Why coding standards?
Readable code for you...
... and for others too!
Maintainable by others
Stop wasting time on reformating the code
No more arguing about line indentions
37. TYPO3 coding standards
http://forge.typo3.org/projects/team-
php_codesniffer
Standards for:
Naming
Documentation
Format
Control structures
and more...
38. Install CodeSniffer
The package can install like this:
$ pear install PHP_CodeSniffer-alpha
Then we register the TYPO3 PEAR Channel, to get
the TYPO3 Coding Standard:
$ pear channel-discover pear.typo3.org
After that you install the TYPO3 Coding Standard
like this:
$ pear install typo3/PHPCS_TYPO3_SniffPool
$ pear install typo3/PHPCS_TYPO3v4_Standard
39. Set default Standard and use it!
Set the default standard and default Tab-With:
$ phpcs --config-set default_standard TYPO3v4
$ phpcs --config-set tab_width 4
Now you can use the CodeSniffer on the console
for your TYPO3-Extensions:
$ phpcs example.php
40. One more time our example code
class Example {
private $title = "t3con";
public function addYear() {
return $this->add_year_2010();
}
public function add_year_2010() {
return $this->title . " 2010";
}
}
41. Run CodeSniffer
Use CodeSniffer on the console:
$ phpcs example.php
--------------------------------------------
FOUND 5 ERROR(S) AFFECTING 4 LINE(S)
--------------------------------------------
3 | ERROR | Missing class doc comment
4 | ERROR | Line indented incorrectly;…
6 | ERROR | Missing function doc comment
9 | ERROR | Missing function doc comment
9 | ERROR | Method name not camel caps
42. Fixing the code
// Missing comment
class Example {
private $title = "t3con"; // Wrong indention
// Missing comment
public function addYear() {
return $this->add_year_2010();
}
// Missing comment
public function add_year_2010() { // Wrong naming
return $this->title . " 2010";
}
}
43. Fixing the code
/**
* An example class.
*
* @author Jon Doe <john.doe@example.com>
*/
class Example {
private $title = "t3con";
/**
* Just an example function.
*
* @return string Some example string
*/
public function addYear() {
return $this->addYear2010();
}
…
44. What developers often think:
Torture and pain
http://www. ickr.com/photos/mhswde/2722217304/
45. What they really are:
Freedom and fun
http://www. ickr.com/photos/davidspinks/4453498888/
46. Other usage options
PHP Tool Integration - Plugin for eclipse
http://www.phpsrc.org/
47. Automate checking
Automate tasks you do often
Use CPU power to help you
On a regular basis or on each commit into your
version control management system
Get reports instead of creating them
Use a continuous integration server like Hudson
or CruiseControl
48. Get support from
the community
Register your extension at
http://forge.typo3.org/start/createProject
49. What is forge?
Integrated social development platform for
extension developers.
Tools to streamline communication on projects
SourceControl-Management
Issue tracker
Wiki
NEW an integrated continuous integration server
still in an early status but ready for some real
world tests!
50. We do quality tests for you
Providing reporting and code metrics
on ci.typo3.org
What is currently checked?
PHP Mess Detection
Copy Paste Detection
Making code reviews quicker and more fun!