SlideShare a Scribd company logo
1 of 33
Download to read offline
FTUG
Ext:form


PHP Static Code Linting
15 11 2017
2
Agenda for today
‣ Ext:form
‣ Custom element
‣ Prototype
‣ Tipps & Tricks
‣ PHP Static Code Linting
3
Ext:form
(aka Form Framework)

Ext:form
4
Ext:form
Die Features:
• Form editor
• PHP API
• Konfiguration
• Form elemente
5
Ext:form
Die Features:
• Finishers
• Validators
• Miscellaneous
6
Ext:form
Nicht nur Formulare lassen sich somit
erstellen:
7
8
Custom element
Ext:form - Custom element
9
Ext:form - Custom element
10
Ext:form - Custom element
11
Ext:form - Custom element
12
Ext:form - Custom element
INPUT Nico
13
Ext:form - Custom element
INPUT Nico
14
Ext:form - Custom element
15
Konfiguration für Backend registrieren
Ext:form - Custom element
16
Konfiguration für Frontend registrieren
Ext:form - Custom element
17
Konfiguration für die Sprachdatei registrieren
Ext:form - Custom element
INPUT Nico
18
19
Prototype
Ext:form - Prototype
• Konfigurationen „leben“ in Prototypen
• “standard“ ist der default
• unterschiedliche Formular-Elemente pro Prototyp
• unterschiedliche vordefinierte Formular-Element

Konfigurationen / Validatoren / etc. pro Prototyp
20
Registrieren eines neuen Prototypes
inkl. „boilerplate“
Ext:form - Prototype
TYPO3:
CMS:
Form:
formManager:
selectablePrototypesConfiguration:
200:
identifier: newPrototypeName
label:'syzygy.formEditor.preset.Form.NewPrototypeName.label'
newFormTemplates:
100:
templatePath:'EXT:some_extension/Resources/Private/Backend/Templates/Form/FormEditor/Yaml/
NewForms/NewFormPreset.yaml'
label: 'syzygy.formEditor.preset.NewPrototypeName.label'
prototypes:
newPrototypeName:
__inheritances:
10: 'TYPO3.CMS.Form.prototypes.standard'
21
Prototype registireren
„boilerplate“
22
Tipps & Tricks
Prototype spezifische Templates,
Layouts, Partials
Ext:form - Tipps & Tricks
TYPO3:
CMS:
Form:
prototypes:
newPrototypeName:
formElementsDefinition:
Form:
renderingOptions:
templateRootPaths:
30: 'EXT:some_extension/Resources/Private/Templates/Form/NewPrototypeName/'
partialRootPaths:
40: 'EXT:some_extension/Resources/Private/Partials/Form/NewPrototypeName/'
layoutRootPaths:
40: ‚EXT:some_extension/Resources/Private/Layouts/Form/NewPrototypeName/'
23
Ext:form - Tipps & Tricks
24
Pro
• Sehr einfache Pflege von Formularen
• Formulare sind versionierbar im 

Projekt (z.B. Git)
• Formular-Definitionen „deploybar“
• Komplexe Anforderungen können

abgebildet werden (z.B. PHP-API, etc.)
Contra
• Formulare sind nicht versioniert

innerhalb TYPO3 (kein sys_history, 

kein workspace, etc.)
• Keine Sichtbarkeit bei Bearbeitung
• Keine Edit-Permissions pro Formular
25
PHP Static Code Linting
WHY?
Find Bugs In Your
Code Without
Writing Tests!
26
27
PHPStan
Static Code Linting mit
28
Current Checks
‣ Existence of classes and interfaces in
instanceof, catch, typehints, other language
constructs and even annotations. PHP does
not do this and just stays silent instead.
‣ Existence of variables while respecting
scopes of branches and loops.
‣ Existence and visibility of called methods
and functions.
‣ Existence and visibility of accessed
properties and constants.
‣ Correct types assigned to properties.
29
Current Checks
‣ Correct number and types of parameters
passed to constructors, methods and functions.
‣ Correct types returned from methods and
functions.
‣ Correct number of parameters passed to
sprintf/printf calls based on format strings.
‣ Useless casts like (string) 'foo'.
‣ Unused constructor parameters - they can
either be deleted or the author forgot to use
them in the class code.
‣ That only objects are passed to the clone
keyword.
• Use composer!!!!!1!!111!!!111
• $ composer require --dev phpstan/phpstan
TYPO3? Object Manager? Repository->findOneByX()?
• $ composer require --dev saschaegerer/phpstan-typo3
RUN
• $ vendor/bin/phpstan analyse -c phpstan.neon -l max
30
How to install
31
DEMO?!
Static Code Linting
Links
32
Links
Ext:from - custom form element
• https://gist.github.com/manuelselbach/dc63abd313694c594d480b163a5f3053
Static code linting
• https://github.com/phpstan/phpstan
• https://github.com/sascha-egerer/phpstan-typo3
33
Thank you

More Related Content

Similar to Frankfurt TYPO3 User Group (FTUG) 2017.11.15

IPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHopIPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHopSteve Kamerman
 
Python Linters at Scale.pdf
Python Linters at Scale.pdfPython Linters at Scale.pdf
Python Linters at Scale.pdfJimmy Lai
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonTEST Huddle
 
Php training100%placement-in-mumbai
Php training100%placement-in-mumbaiPhp training100%placement-in-mumbai
Php training100%placement-in-mumbaivibrantuser
 
Innovative php development
Innovative php developmentInnovative php development
Innovative php developmentTigran Azatyan
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationabhishek singh
 
Code analysis tools (for PHP)
Code analysis tools (for PHP)Code analysis tools (for PHP)
Code analysis tools (for PHP)Karlen Kishmiryan
 
Session 04 - Object Repository Contd.
Session 04 - Object Repository Contd.Session 04 - Object Repository Contd.
Session 04 - Object Repository Contd.rajaselv
 
Non-Blocking Strategies for FFI
 Non-Blocking Strategies for FFI Non-Blocking Strategies for FFI
Non-Blocking Strategies for FFIESUG
 
20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboardsDenis Ristic
 
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...44CON
 
Modern Static Code Analysis in PHP
Modern Static Code Analysis in PHPModern Static Code Analysis in PHP
Modern Static Code Analysis in PHPVladimir Reznichenko
 
PHP to Hack at Slack
PHP to Hack at SlackPHP to Hack at Slack
PHP to Hack at SlackScott Sandler
 
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 codeGabriele Santini
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationTim Burks
 
9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHPTerry Yoast
 
Preparing code for Php 7 workshop
Preparing code for Php 7 workshopPreparing code for Php 7 workshop
Preparing code for Php 7 workshopDamien Seguy
 
How to become a Rational Developer for IBM i Power User
How to become a Rational Developer for IBM i Power UserHow to become a Rational Developer for IBM i Power User
How to become a Rational Developer for IBM i Power UserStrongback Consulting
 

Similar to Frankfurt TYPO3 User Group (FTUG) 2017.11.15 (20)

IPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHopIPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHop
 
Python Linters at Scale.pdf
Python Linters at Scale.pdfPython Linters at Scale.pdf
Python Linters at Scale.pdf
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 
Php training100%placement-in-mumbai
Php training100%placement-in-mumbaiPhp training100%placement-in-mumbai
Php training100%placement-in-mumbai
 
Innovative php development
Innovative php developmentInnovative php development
Innovative php development
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentation
 
Code analysis tools (for PHP)
Code analysis tools (for PHP)Code analysis tools (for PHP)
Code analysis tools (for PHP)
 
Session 04 - Object Repository Contd.
Session 04 - Object Repository Contd.Session 04 - Object Repository Contd.
Session 04 - Object Repository Contd.
 
Non-Blocking Strategies for FFI
 Non-Blocking Strategies for FFI Non-Blocking Strategies for FFI
Non-Blocking Strategies for FFI
 
20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards
 
TYPO3 FormZ
TYPO3 FormZTYPO3 FormZ
TYPO3 FormZ
 
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
44CON London 2015 - Reverse engineering and exploiting font rasterizers: the ...
 
Modern Static Code Analysis in PHP
Modern Static Code Analysis in PHPModern Static Code Analysis in PHP
Modern Static Code Analysis in PHP
 
PHP to Hack at Slack
PHP to Hack at SlackPHP to Hack at Slack
PHP to Hack at Slack
 
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
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
 
9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP9780538745840 ppt ch01 PHP
9780538745840 ppt ch01 PHP
 
Preparing code for Php 7 workshop
Preparing code for Php 7 workshopPreparing code for Php 7 workshop
Preparing code for Php 7 workshop
 
How to become a Rational Developer for IBM i Power User
How to become a Rational Developer for IBM i Power UserHow to become a Rational Developer for IBM i Power User
How to become a Rational Developer for IBM i Power User
 
Php
PhpPhp
Php
 

Recently uploaded

%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 

Recently uploaded (20)

%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 

Frankfurt TYPO3 User Group (FTUG) 2017.11.15

  • 2. 2 Agenda for today ‣ Ext:form ‣ Custom element ‣ Prototype ‣ Tipps & Tricks ‣ PHP Static Code Linting
  • 5. Ext:form Die Features: • Form editor • PHP API • Konfiguration • Form elemente 5
  • 6. Ext:form Die Features: • Finishers • Validators • Miscellaneous 6
  • 7. Ext:form Nicht nur Formulare lassen sich somit erstellen: 7
  • 9. Ext:form - Custom element 9
  • 10. Ext:form - Custom element 10
  • 11. Ext:form - Custom element 11
  • 12. Ext:form - Custom element 12
  • 13. Ext:form - Custom element INPUT Nico 13
  • 14. Ext:form - Custom element INPUT Nico 14
  • 15. Ext:form - Custom element 15 Konfiguration für Backend registrieren
  • 16. Ext:form - Custom element 16 Konfiguration für Frontend registrieren
  • 17. Ext:form - Custom element 17 Konfiguration für die Sprachdatei registrieren
  • 18. Ext:form - Custom element INPUT Nico 18
  • 20. Ext:form - Prototype • Konfigurationen „leben“ in Prototypen • “standard“ ist der default • unterschiedliche Formular-Elemente pro Prototyp • unterschiedliche vordefinierte Formular-Element
 Konfigurationen / Validatoren / etc. pro Prototyp 20
  • 21. Registrieren eines neuen Prototypes inkl. „boilerplate“ Ext:form - Prototype TYPO3: CMS: Form: formManager: selectablePrototypesConfiguration: 200: identifier: newPrototypeName label:'syzygy.formEditor.preset.Form.NewPrototypeName.label' newFormTemplates: 100: templatePath:'EXT:some_extension/Resources/Private/Backend/Templates/Form/FormEditor/Yaml/ NewForms/NewFormPreset.yaml' label: 'syzygy.formEditor.preset.NewPrototypeName.label' prototypes: newPrototypeName: __inheritances: 10: 'TYPO3.CMS.Form.prototypes.standard' 21 Prototype registireren „boilerplate“
  • 23. Prototype spezifische Templates, Layouts, Partials Ext:form - Tipps & Tricks TYPO3: CMS: Form: prototypes: newPrototypeName: formElementsDefinition: Form: renderingOptions: templateRootPaths: 30: 'EXT:some_extension/Resources/Private/Templates/Form/NewPrototypeName/' partialRootPaths: 40: 'EXT:some_extension/Resources/Private/Partials/Form/NewPrototypeName/' layoutRootPaths: 40: ‚EXT:some_extension/Resources/Private/Layouts/Form/NewPrototypeName/' 23
  • 24. Ext:form - Tipps & Tricks 24 Pro • Sehr einfache Pflege von Formularen • Formulare sind versionierbar im 
 Projekt (z.B. Git) • Formular-Definitionen „deploybar“ • Komplexe Anforderungen können
 abgebildet werden (z.B. PHP-API, etc.) Contra • Formulare sind nicht versioniert
 innerhalb TYPO3 (kein sys_history, 
 kein workspace, etc.) • Keine Sichtbarkeit bei Bearbeitung • Keine Edit-Permissions pro Formular
  • 26. WHY? Find Bugs In Your Code Without Writing Tests! 26
  • 28. 28 Current Checks ‣ Existence of classes and interfaces in instanceof, catch, typehints, other language constructs and even annotations. PHP does not do this and just stays silent instead. ‣ Existence of variables while respecting scopes of branches and loops. ‣ Existence and visibility of called methods and functions. ‣ Existence and visibility of accessed properties and constants. ‣ Correct types assigned to properties.
  • 29. 29 Current Checks ‣ Correct number and types of parameters passed to constructors, methods and functions. ‣ Correct types returned from methods and functions. ‣ Correct number of parameters passed to sprintf/printf calls based on format strings. ‣ Useless casts like (string) 'foo'. ‣ Unused constructor parameters - they can either be deleted or the author forgot to use them in the class code. ‣ That only objects are passed to the clone keyword.
  • 30. • Use composer!!!!!1!!111!!!111 • $ composer require --dev phpstan/phpstan TYPO3? Object Manager? Repository->findOneByX()? • $ composer require --dev saschaegerer/phpstan-typo3 RUN • $ vendor/bin/phpstan analyse -c phpstan.neon -l max 30 How to install
  • 32. Links 32 Links Ext:from - custom form element • https://gist.github.com/manuelselbach/dc63abd313694c594d480b163a5f3053 Static code linting • https://github.com/phpstan/phpstan • https://github.com/sascha-egerer/phpstan-typo3