5. 08/2019
DOCTRINE ANNOTATIONS
What is it?
▪ doctrine/annotations is a “library that lets you
parse structured data out of PHP docblocks”
▪ Doctrine Annotations offers to implement custom
annotation functionality
▪ It’s based on and enhances doc blocks
▪ Annotations are represented by PHP classes
5
6. 08/2019
DOCTRINE ANNOTATIONS
What are they used for?
▪ They are used for the configuration of Validation,
Extbase DI (dependency injection) and the ORM
(object-relation mapping)
6
7. 08/2019
DOCTRINE ANNOTATIONS
Benefits for TYPO3 and Extbase
▪ Annotations and possible annotation options are
represented by actual PHP classes
▪ Annotations can be registered for specific targets
https://www.doctrine-project.org/projects/doctrine-
annotations/en/latest/custom.html#annotation-
target
▪ Less source code to maintain and test
7
8. 08/2019
DOCTRINE ANNOTATIONS
Benefits for Developers
▪ Annotations are actual classes, therefore they can
optionally be
▪ used with their fully qualified class name
or
▪ imported via use statement und used with their class name
or
▪ imported via use statement and aliased
▪ Some IDEs provide support for doctrine annotations:
https://www.doctrine-project.org/projects/doctrine-annotations/en/
latest/index.html#ide-support
8
9. 08/2019
DOCTRINE ANNOTATIONS
How to replace @cascade
▪ https://docs.typo3.org/c/typo3/cms-core/
master/en-us/Changelog/9.0/Feature-83093-
ReplaceCascadeWithTYPO3CMSExtbaseAnno
tationORMCascade.html
9
10. 08/2019
DOCTRINE ANNOTATIONS
How to replace @lazy
▪ https://docs.typo3.org/c/typo3/cms-core/
master/en-us/Changelog/9.0/Feature-83078-
ReplaceLazyWithTYPO3CMSExtbaseAnnotati
onORMLazy.html
10
11. 08/2019
DOCTRINE ANNOTATIONS
How to replace @transient
▪ https://docs.typo3.org/c/typo3/cms-core/
master/en-us/Changelog/9.0/Feature-83092-
ReplaceTransientWithTYPO3CMSExtbaseAnn
otationORMTransient.html
11
12. 08/2019
DOCTRINE ANNOTATIONS
How to replace @ignorevalidation
▪ https://docs.typo3.org/c/typo3/cms-core/
master/en-us/Changelog/9.0/Feature-83094-
ReplaceIgnorevalidationWithTYPO3CMSExtba
seAnnotationIgnoreValidation.html
12
13. 08/2019
DOCTRINE ANNOTATIONS
How to replace @inject
▪ https://docs.typo3.org/c/typo3/cms-core/
master/en-us/Changelog/9.0/Feature-82869-
ReplaceInjectWithTYPO3CMSExtbaseAnnotati
onInject.html
13
14. 08/2019
DOCTRINE ANNOTATIONS
How to replace @validate
▪ https://docs.typo3.org/c/typo3/cms-core/
master/en-us/Changelog/9.3/Feature-83167-
ReplaceValidateWithTYPO3CMSExtbaseAnnot
ationValidate.html
14
16. 08/2019
REFLECTION
What does Extbase use Reflection for?
▪ Gather information about property and method
parameter types
▪ Detect custom annotations in doc blocks to
provide basic features like validation and
dependency injection
16
17. 08/2019
REFLECTION
Reflection until Extbase 8.7
▪ Extbase implemented two different reflection API’s
▪ One API gathered DI related information
(extbase_object)
▪ Another gathered validation and ORM related information
(extbase_reflection)
▪ Both reflection API’s gathered and cached similar information
▪ The extbase_reflection cache stored reflection data for each plugin
separately
▪ Reflection information had often been fetched uncached
17
18. 08/2019
REFLECTION
Reflection since Extbase 9.5
▪ There is only one Reflection API that gathers all the data
Extbase needs during runtime
▪ Reflection data is:
▪ gathered only once
▪ globally valid
▪ stored in the file system by default
▪ The Reflection cache can (technically) be warmed up before
runtime.
18
19. 08/2019
REFLECTION
List of relevant patches
▪ https://review.typo3.org/c/Packages/TYPO3.CMS/
+/54381
▪ https://review.typo3.org/c/Packages/TYPO3.CMS/
+/54482
▪ https://review.typo3.org/c/Packages/TYPO3.CMS/
+/55261
19
22. 08/2019
REFLECTION
Reflection API changes in Extbase 10.0
▪ To provide a more fluent Reflection API, classes have
been introduced for the Reflection data of:
▪ Class properties
▪ Class methods
▪ Class method parameters
▪ The size (byte wise) of serialized Reflection data has
been significantly reduced with the help of bit sets.
22
23. 08/2019
REFLECTION
List of relevant patches
▪ https://review.typo3.org/c/Packages/TYPO3.CMS/
+/59382
▪ https://review.typo3.org/c/Packages/TYPO3.CMS/
+/59422
▪ https://review.typo3.org/c/Packages/TYPO3.CMS/
+/59626
23
25. 08/2019
PLUGIN CONFIGURATION
Fully Qualified Controller Class Names
▪ Fully qualified controller class names need to be
provided for configuring/registering plugins/modules
▪ Affected methods:
▪ TYPO3CMSExtbaseUtilityExtensionUtility
::configurePlugin
▪ TYPO3CMSExtbaseUtilityExtensionUtility
::registerModule
25
26. 08/2019
PLUGIN CONFIGURATION
Fully Qualified Controller Class Names
▪ Documentation for this change
https://docs.typo3.org/c/typo3/cms-core/master/
en-us/Changelog/10.0/Deprecation-87550-
UseControllerClassesWhenRegisteringPluginsmo
dules.html
26
27. 08/2019
PLUGIN CONFIGURATION
Obsolete vendor names
▪ Vendor names are no longer necessary for
configuring/registering plugins/modules
▪ Affected methods:
▪ TYPO3CMSExtbaseUtilityExtensionUtility
::configurePlugin
▪ TYPO3CMSExtbaseUtilityExtensionUtility
::registerModule
27
28. 08/2019
PLUGIN CONFIGURATION
Obsolete vendor names
▪ Documentation for this change
https://docs.typo3.org/c/typo3/cms-core/master/
en-us/Changelog/10.0/Deprecation-87550-
UseControllerClassesWhenRegisteringPluginsmo
dules.html
28
29. 08/2019
PLUGIN CONFIGURATION
Mapping of classes to database tables
▪ Support for config.tx_extbase.persistence.classes
(TypoScript) has been removed (breaking)
▪ Configuration has to be provided via
Configuration/Extbase/Persistence/Classes.php
29
30. 08/2019
PLUGIN CONFIGURATION
Mapping of classes to database tables
▪ Documentation for this change
https://docs.typo3.org/c/typo3/cms-core/master/
en-us/Changelog/10.0/Breaking-87623-
ReplaceConfigpersistenceclassesTyposcriptConfi
guration.html
30
31. 08/2019
PLUGIN CONFIGURATION
Registration of request handlers
▪ Support for
config.tx_extbase.mvc.requestHandlers
(TypoScript) has been removed (breaking)
▪ Configuration has to be provided via
Configuration/Extbase/RequestHandlers.php
31
32. 08/2019
PLUGIN CONFIGURATION
Registration of request handlers
▪ Documentation for this change
https://docs.typo3.org/c/typo3/cms-core/master/
en-us/Changelog/10.0/Breaking-88687-
ConfigureExtbaseRequestHandlersViaPHP.html
32
34. 08/2019
VALIDATION
Auto-Registration of Validators
▪ The following validators had been registered
automagically:
▪ Domain validators in Domain/Validator/
▪ Type Validators for model properties and action
method parameters
▪ Both are no longer registered automatically
34
35. 08/2019
VALIDATION
Auto-Registration of Validators
▪ Issues with automagically registered validators:
▪ No indication which validators are used
▪ No possibility to deactivate validators
▪ Violates the concept of validation groups
35
36. 08/2019
VALIDATION
Auto-Registration of Validators
▪ Benefits from removing auto-registration of
validators:
▪ Source code is more explicit and verbose
▪ You are in control
▪ Validation groups can be implemented
36
38. 08/2019
BREAKING CHANGES
Extension-Key-Guessing
▪ The AbstractController does no longer guess the
extension key by looking at the namespace of the
current controller class.
▪ AbstractController::$extensionName has been
removed
38
41. 08/2019
BREAKING CHANGES
Removed View-Properties in ActionController
▪ The property ActionController::
$namespacesViewObjectNamePattern has been
removed.
▪ The property ActionController::
$viewFormatToObjectNameMap has been
removed.
41
42. 08/2019
BREAKING CHANGES
Removed View-Properties in ActionController
▪ There were 3 possibilites to change the view
class:
▪ $defaultViewObjectName
▪ $namespacesViewObjectNamePattern
▪ $viewFormatToObjectNameMap
42
43. 08/2019
BREAKING CHANGES
Removed View-Properties in ActionController
▪ There were 3 possibilites to change the view class:
▪ $defaultViewObjectName
▪ $namespacesViewObjectNamePattern
▪ $viewFormatToObjectNameMap
▪ Just use $defaultViewObjectName
43
44. 08/2019
BREAKING CHANGES
Removed View-Properties in ActionController
▪ Documentation for this change
▪ https://docs.typo3.org/c/typo3/cms-core/master/en-us/
Changelog/10.0/Breaking-87511-
RemoveNamespacesViewObjectNamePatternProperty.ht
ml
▪ https://docs.typo3.org/c/typo3/cms-core/master/en-us/
Changelog/10.0/Breaking-87511-
RemoveViewFormatToObjectNameMapProperty.html
44
46. 08/2019
FEATURES
symfony/property-info
▪ The package allows for a quite performant
detection of non FQCN’s in PHP doc blocks
▪ Examples:
▪ @var ObjectStorage<CollectionType>
▪ @var EntityRepository
@ExtbaseInject
46