SlideShare a Scribd company logo
1 of 154
Download to read offline
Annotations
 in
 PHP 
Rafael
 Dohms 
@rdohms 
They
 Exist! 
on
 twitter
I’m a Brazilian, living in Amsterdam 
which means I’m probably crazy, 
and I speak with my hands
I’m a developer and speaker for… ever. 
ok its something like 14 years
I’m a serial User Group creator 
I can’t help it
I have absolutely no solid Laravel experience
I have absolutely no solid Laravel experience 
I’m sorry.
I have absolutely no solid Laravel experience 
I’m sorry.
I have absolutely no solid Laravel experience 
I’m sorry. 
Don’t throw tomatoes 
photo by araswami
I have absolutely no solid Laravel experience 
I’m sorry. 
Don’t throw tomatoes 
I’m allergic. 
photo by araswami
existing
 uses 
What? Why? Where? 
How? 
a
 little
 history 
Implementing
 custom
 annotations 
based
 on
 DMSFilter 
show
 me
 the
 code!
what? 
What
 are
 annotations? 
http://ecdesignrebels.blogspot.com
-- In English -- 
An annotation is a note that is made while 
reading any form of text.
something
 that
 describes
 an
 aspect
 of
 the
 subject 
-- In English -- 
An annotation is a note that is made while 
reading any form of text.
-- In Code Speak -- 
“An annotation is metadata attached to your 
code, that can be read at runtime.” 
“Annotations do not directly affect program 
semantics”
-- In Code Speak -- 
“An annotation is metadata attached to your 
code, that can be read at runtime.” 
effects
 are
 only
 observed
 at 
“Annotations do not directly affect program 
semantics”
-- In Code Speak -- 
“An annotation is metadata attached to your 
code, that can be read at runtime.” 
effects
 are
 only
 observed
 at 
“Annotations do not directly affect program 
semantics” 
just
 like
 your
 notes
Annotations in the wild 
C#
Annotations in the wild 
annotations 
C# 
attributes
Annotations in the wild 
annotations 
C# 
attributes 
@Entity! 
@Table(name = people)! 
class Person implements Serializable {! 
@Id ! 
@GeneratedValue(strategy = GenerationType.AUTO) ! 
private Integer id;
Annotations in the wild 
annotations 
C# 
attributes 
@Entity! 
@Table(name = people)! 
class Person implements Serializable {! 
@Id ! 
@GeneratedValue(strategy = GenerationType.AUTO) ! 
private Integer id; 
public class Customer! 
{! 
[Required]! 
[StringLength(50)]! 
public string Prename { get; set; }! 
! 
[Column(TypeName = image)]! 
public byte[] Image { get; set; }
Annotations in the wild 
annotations 
after
 v1.5 
C# 
attributes 
@Entity! 
@Table(name = people)! 
class Person implements Serializable {! 
@Id ! 
@GeneratedValue(strategy = GenerationType.AUTO) ! 
private Integer id; 
public class Customer! 
{! 
[Required]! 
[StringLength(50)]! 
public string Prename { get; set; }! 
! 
[Column(TypeName = image)]! 
public byte[] Image { get; set; }
Annotations in the wild 
annotations 
after
 v1.5 
C# 
attributes 
since
 first
 release 
@Entity! 
@Table(name = people)! 
class Person implements Serializable {! 
@Id ! 
@GeneratedValue(strategy = GenerationType.AUTO) ! 
private Integer id; 
public class Customer! 
{! 
[Required]! 
[StringLength(50)]! 
public string Prename { get; set; }! 
! 
[Column(TypeName = image)]! 
public byte[] Image { get; set; }
No
 core
 
  
annotation
 support
Questions?
Questions? 
I’m
 kidding!
phpDoc 
~2000
phpDoc 
PHP
 5.1 
Reflection
 supports
  
getDocComments() 
~2000 2005
Reflection
 supports
  
getDocComments() 
phpDoc 
PHP
 5.1 
~2000 2005 
First
  
Annotation
 
 Engines
 in
 PHP
Reflection
 supports
  
getDocComments() 
phpDoc 
PHP
 5.1 
~2000 2005 2008 
First
  
Annotation
 
 Engines
 in
 PHP
Reflection
 supports
  
getDocComments() 
phpDoc 
PHP
 5.1 
~2000 2005 2008 
First
  
Annotation
 
 Engines
 in
 PHP 
Doctrine
 2
  
Annotation
 Engine
Reflection
 supports
  
getDocComments() 
phpDoc 
PHP
 5.1 
RFC:
 Annotations
  
in
 core
 w/
 custom
  
~2000 2005 2008 
First
  
Annotation
 
 Engines
 in
 PHP 
syntax 
2010 
Doctrine
 2
  
Annotation
 Engine
Reflection
 supports
  
getDocComments() 
phpDoc 
PHP
 5.1 
syntax REJECTED 
RFC:
 Annotations
  
in
 core
 w/
 custom
  
~2000 2005 2008 
First
  
Annotation
 
 Engines
 in
 PHP 
2010 
Doctrine
 2
  
Annotation
 Engine
Reflection
 supports
  
getDocComments() 
phpDoc 
PHP
 5.1 
RFC:
 DocBlock
  
Annotations
  
“in
 discussion” 
REJECTED 
RFC:
 Annotations
  
in

More Related Content

What's hot

<b>PHP</b> Reference: Beginner to Intermediate <b>PHP5</b>
<b>PHP</b> Reference: Beginner to Intermediate <b>PHP5</b><b>PHP</b> Reference: Beginner to Intermediate <b>PHP5</b>
<b>PHP</b> Reference: Beginner to Intermediate <b>PHP5</b>
tutorialsruby
 
Real-World Scala Design Patterns
Real-World Scala Design PatternsReal-World Scala Design Patterns
Real-World Scala Design Patterns
NLJUG
 
Chapter1pp
Chapter1ppChapter1pp
Chapter1pp
J. C.
 
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
 

What's hot (20)

Dart programming language
Dart programming languageDart programming language
Dart programming language
 
MongoDB.local Berlin: How to add your favorite language to MongoDB Compass
MongoDB.local Berlin: How to add your favorite language to MongoDB CompassMongoDB.local Berlin: How to add your favorite language to MongoDB Compass
MongoDB.local Berlin: How to add your favorite language to MongoDB Compass
 
Clean code
Clean codeClean code
Clean code
 
<b>PHP</b> Reference: Beginner to Intermediate <b>PHP5</b>
<b>PHP</b> Reference: Beginner to Intermediate <b>PHP5</b><b>PHP</b> Reference: Beginner to Intermediate <b>PHP5</b>
<b>PHP</b> Reference: Beginner to Intermediate <b>PHP5</b>
 
NLP using JavaScript Natural Library
NLP using JavaScript Natural LibraryNLP using JavaScript Natural Library
NLP using JavaScript Natural Library
 
Ruby
RubyRuby
Ruby
 
Four Languages From Forty Years Ago
Four Languages From Forty Years AgoFour Languages From Forty Years Ago
Four Languages From Forty Years Ago
 
Writing SOLID code (in practice)
Writing SOLID code (in practice)Writing SOLID code (in practice)
Writing SOLID code (in practice)
 
Write your Ruby in Style
Write your Ruby in StyleWrite your Ruby in Style
Write your Ruby in Style
 
Beyond design patterns phpnw14
Beyond design patterns   phpnw14Beyond design patterns   phpnw14
Beyond design patterns phpnw14
 
Overcoming The Impedance Mismatch Between Source Code And Architecture
Overcoming The Impedance Mismatch Between Source Code And ArchitectureOvercoming The Impedance Mismatch Between Source Code And Architecture
Overcoming The Impedance Mismatch Between Source Code And Architecture
 
F# for startups
F# for startupsF# for startups
F# for startups
 
Real-World Scala Design Patterns
Real-World Scala Design PatternsReal-World Scala Design Patterns
Real-World Scala Design Patterns
 
Chapter1pp
Chapter1ppChapter1pp
Chapter1pp
 
Scala’s implicits
Scala’s implicitsScala’s implicits
Scala’s implicits
 
Overview of php
Overview of phpOverview of php
Overview of php
 
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
 
pebble - Building apps on pebble
pebble - Building apps on pebblepebble - Building apps on pebble
pebble - Building apps on pebble
 
Pigaios: A Tool for Diffing Source Codes against Binaries (Hacktivity 2018)
Pigaios: A Tool for Diffing Source Codes against Binaries (Hacktivity 2018)Pigaios: A Tool for Diffing Source Codes against Binaries (Hacktivity 2018)
Pigaios: A Tool for Diffing Source Codes against Binaries (Hacktivity 2018)
 
Survey on Script-based languages to write a Chatbot
Survey on Script-based languages to write a ChatbotSurvey on Script-based languages to write a Chatbot
Survey on Script-based languages to write a Chatbot
 

Similar to Annotations in PHP, They Exist.

Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)
Arjun Shanka
 
Listen and look at your PHP code
Listen and look at your PHP codeListen and look at your PHP code
Listen and look at your PHP code
Gabriele Santini
 

Similar to Annotations in PHP, They Exist. (20)

Introduction to-php
Introduction to-phpIntroduction to-php
Introduction to-php
 
Open event (show&tell april 2016)
Open event (show&tell april 2016)Open event (show&tell april 2016)
Open event (show&tell april 2016)
 
Annotating with Annotations - PHPBenelux June/2012
Annotating with Annotations - PHPBenelux June/2012Annotating with Annotations - PHPBenelux June/2012
Annotating with Annotations - PHPBenelux June/2012
 
Practical PowerShell Programming for Professional People
Practical PowerShell Programming for Professional PeoplePractical PowerShell Programming for Professional People
Practical PowerShell Programming for Professional People
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
PHP Syntax & Comments
PHP Syntax & CommentsPHP Syntax & Comments
PHP Syntax & Comments
 
Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)
 
Php tutorialw3schools
Php tutorialw3schoolsPhp tutorialw3schools
Php tutorialw3schools
 
Annotating with Annotations
Annotating with AnnotationsAnnotating with Annotations
Annotating with Annotations
 
APIs And SDKs Breaking Into And Succeeding In A Specialty Market
APIs And SDKs  Breaking Into And Succeeding In A Specialty MarketAPIs And SDKs  Breaking Into And Succeeding In A Specialty Market
APIs And SDKs Breaking Into And Succeeding In A Specialty Market
 
My 10 favorite haxe language features in 30 mins
My 10 favorite haxe language features in 30 minsMy 10 favorite haxe language features in 30 mins
My 10 favorite haxe language features in 30 mins
 
Listen and look at your PHP code
Listen and look at your PHP codeListen and look at your PHP code
Listen and look at your PHP code
 
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
 
Write code that writes code!
Write code that writes code!Write code that writes code!
Write code that writes code!
 
Modelling and Programming: Isn’t it all the same?
Modelling and Programming: Isn’t it all the same?Modelling and Programming: Isn’t it all the same?
Modelling and Programming: Isn’t it all the same?
 
RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!
 
Code Generation using T4
Code Generation using T4Code Generation using T4
Code Generation using T4
 
Python overview
Python overviewPython overview
Python overview
 
Using Zend_Tool to Establish Your Project's Skeleton
Using Zend_Tool to Establish Your Project's SkeletonUsing Zend_Tool to Establish Your Project's Skeleton
Using Zend_Tool to Establish Your Project's Skeleton
 
One App, Multiple Platforms
One App, Multiple PlatformsOne App, Multiple Platforms
One App, Multiple Platforms
 

More from Rafael Dohms

More from Rafael Dohms (20)

The Individual Contributor Path - DPC2024
The Individual Contributor Path - DPC2024The Individual Contributor Path - DPC2024
The Individual Contributor Path - DPC2024
 
Application Metrics - IPC2023
Application Metrics - IPC2023Application Metrics - IPC2023
Application Metrics - IPC2023
 
How'd we get here? A guide to Architectural Decision Records
How'd we get here? A guide to Architectural Decision RecordsHow'd we get here? A guide to Architectural Decision Records
How'd we get here? A guide to Architectural Decision Records
 
Architectural Decision Records - PHPConfBR
Architectural Decision Records - PHPConfBRArchitectural Decision Records - PHPConfBR
Architectural Decision Records - PHPConfBR
 
Application Metrics (with Prometheus examples)
Application Metrics (with Prometheus examples)Application Metrics (with Prometheus examples)
Application Metrics (with Prometheus examples)
 
Application metrics - Confoo 2019
Application metrics - Confoo 2019Application metrics - Confoo 2019
Application metrics - Confoo 2019
 
Writing code you won’t hate tomorrow - PHPCE18
Writing code you won’t hate tomorrow - PHPCE18Writing code you won’t hate tomorrow - PHPCE18
Writing code you won’t hate tomorrow - PHPCE18
 
Application Metrics (with Prometheus examples) #PHPDD18
Application Metrics (with Prometheus examples) #PHPDD18Application Metrics (with Prometheus examples) #PHPDD18
Application Metrics (with Prometheus examples) #PHPDD18
 
Application metrics with Prometheus - DPC18
Application metrics with Prometheus - DPC18Application metrics with Prometheus - DPC18
Application metrics with Prometheus - DPC18
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
 
Composer The Right Way - 010PHP
Composer The Right Way - 010PHPComposer The Right Way - 010PHP
Composer The Right Way - 010PHP
 
Writing Code That Lasts - #Magento2Seminar, Utrecht
Writing Code That Lasts - #Magento2Seminar, UtrechtWriting Code That Lasts - #Magento2Seminar, Utrecht
Writing Code That Lasts - #Magento2Seminar, Utrecht
 
Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16Composer the Right Way - PHPSRB16
Composer the Right Way - PHPSRB16
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
 
Composer The Right Way - PHPUGMRN
Composer The Right Way - PHPUGMRNComposer The Right Way - PHPUGMRN
Composer The Right Way - PHPUGMRN
 
Composer the Right Way - PHPBNL16
Composer the Right Way - PHPBNL16Composer the Right Way - PHPBNL16
Composer the Right Way - PHPBNL16
 
“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.
 
A Journey into your Lizard Brain - PHP Conference Brasil 2015
A Journey into your Lizard Brain - PHP Conference Brasil 2015A Journey into your Lizard Brain - PHP Conference Brasil 2015
A Journey into your Lizard Brain - PHP Conference Brasil 2015
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
"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 ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Annotations in PHP, They Exist.