[BUGFIX] Deprecate dependency injection with non public properties 81/58881/3
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Mon, 3 Dec 2018 12:48:24 +0000 (13:48 +0100)
committerBenni Mack <benni@typo3.org>
Mon, 3 Dec 2018 20:02:33 +0000 (21:02 +0100)
Using non public properties for dependency injection has been
deprecated. While dependency injection with public properties
still works, it is recommended to switch to constructor or
setter injection.

Releases: master
Resolves: #86907
Change-Id: I48b076cd4594cd94aeec7be4973b7102e1eab2f5
Reviewed-on: https://review.typo3.org/58881
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/9.5.x/Deprecation-86907-DeprecateUsageOfDependencyInjectionWithNonPublicProperties.rst [new file with mode: 0644]
typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyAnnotationMatcher.php

diff --git a/typo3/sysext/core/Documentation/Changelog/9.5.x/Deprecation-86907-DeprecateUsageOfDependencyInjectionWithNonPublicProperties.rst b/typo3/sysext/core/Documentation/Changelog/9.5.x/Deprecation-86907-DeprecateUsageOfDependencyInjectionWithNonPublicProperties.rst
new file mode 100644 (file)
index 0000000..a585bfa
--- /dev/null
@@ -0,0 +1,34 @@
+.. include:: ../../Includes.txt
+
+========================================================================================
+Deprecation: #86907 - Deprecate usage of dependency injection with non public properties
+========================================================================================
+
+See :issue:`86907`
+
+Description
+===========
+
+The dependency injection via properties has been deprecated for all properties that are non public.
+
+While there are several reasons not to use property injection at all there is one specific drawback with non public properties. To be able to inject dependencies into non public properties, said properties have to be made accessible during runtime. As that process is quite slow and expensive and non cachable, it should not be used at all.
+
+
+Impact
+======
+
+Dependency injection will no longer work with non public properties
+
+
+Affected Installations
+======================
+
+All installations that use dependency injection with non public properties.
+
+
+Migration
+=========
+
+The easiest, yet ugliest migration is to make the property public. If possible, switch to constructor or setter injection instead.
+
+.. index:: PHP-API, PartiallyScanned, ext:extbase
index ffb3091..5aed43b 100644 (file)
@@ -4,6 +4,7 @@ return [
         'restFiles' => [
             'Feature-82869-ReplaceInjectWithTYPO3CMSExtbaseAnnotationInject.rst',
             'Deprecation-82869-ReplaceInjectWithTYPO3CMSExtbaseAnnotationInject.rst',
+            'Deprecation-86907-DeprecateUsageOfDependencyInjectionWithNonPublicProperties.rst',
         ],
     ],
     '@lazy' => [