66995[!!!][TASK] Remove SingletonInterface from prototype classes
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 25
- typo3/sysext/core/Classes/Database/SoftReferenceIndex.php+1 −2
- typo3/sysext/core/Classes/Resource/Security/FileMetadataPermissionsAspect.php+1 −2
- typo3/sysext/core/Classes/Routing/SiteMatcher.php+1 −2
- typo3/sysext/core/Classes/Service/FlexFormService.php1+1 −2
- typo3/sysext/core/Classes/Session/SessionManager.php1+1 −2
- typo3/sysext/core/Configuration/Services.yaml1+3 −0
- typo3/sysext/core/Documentation/Changelog/master/Breaking-93028-SingletonInterfaceRemovedFromSeveralPHPClasses.rstnew+70 −0
- typo3/sysext/extbase/Classes/Security/Cryptography/HashService.php1+1 −2
- typo3/sysext/extbase/Classes/Service/ImageService.php+1 −2
- typo3/sysext/extbase/Configuration/Services.yaml+3 −0
- typo3/sysext/extensionmanager/Classes/Domain/Model/DownloadQueue.php+1 −2
- typo3/sysext/extensionmanager/Classes/Service/ExtensionManagementService.php1+1 −2
- typo3/sysext/extensionmanager/Classes/Utility/DependencyUtility.php1+1 −2
- typo3/sysext/extensionmanager/Classes/Utility/EmConfUtility.php1+1 −2
- typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php1+1 −2
- typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php1+1 −2
- typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php1+1 −2
- typo3/sysext/extensionmanager/Tests/Unit/Report/ExtensionStatusTest.php+1 −2
- typo3/sysext/filelist/Classes/Configuration/ThumbnailConfiguration.php+1 −2
- typo3/sysext/form/Configuration/Services.yaml+3 −0
Show 5 more files
- typo3/sysext/frontend/Classes/Hooks/MediaItemHooks.php+1 −2
- typo3/sysext/frontend/Tests/Unit/Authentication/FrontendUserAuthenticationTest.php+8 −6
- typo3/sysext/t3editor/Classes/T3editor.php1+1 −2
- typo3/sysext/workspaces/Classes/Service/Dependency/CollectionService.php1+1 −2
- typo3/sysext/workspaces/Classes/Service/HistoryService.php+1 −2
Review log 1523
-
Benni Mack uploaded patch set 1 12/04/20, 10:21
-
TYPO3com voted on patch set 1 V -1 12/04/20, 10:29 Completed build in 07m 55s on Fri, 4 Dec, 10:29 AM Test Summary: 3930 of 32550 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7776
-
Benni Mack uploaded patch set 2 12/04/20, 12:29
-
TYPO3com voted on patch set 2 V -1 12/04/20, 12:38 Completed build in 08m 34s on Fri, 4 Dec, 12:38 PM Test Summary: 970 of 32646 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7782
-
Benni Mack uploaded patch set 3 12/04/20, 12:55
-
TYPO3com voted on patch set 3 V +1 12/04/20, 13:04 Completed build in 08m 51s on Fri, 4 Dec, 01:04 PM Test Summary: 32405 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7783
-
Benni Mack uploaded patch set 4 12/07/20, 07:50
-
TYPO3com voted on patch set 4 V -1 12/07/20, 08:00 Completed build in 09m 48s on Mon, 7 Dec, 08:00 AM Test Summary: 31540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7884
-
TYPO3com voted on patch set 4 V +1 12/07/20, 08:09 Completed build in 28m 33s on Mon, 7 Dec, 08:09 AM Test Summary: 32413 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7884
-
Benni Mack updated the commit message in patch set 5 12/07/20, 08:46
-
TYPO3com voted on patch set 5 V +1 12/07/20, 08:55 Completed build in 09m 26s on Mon, 7 Dec, 08:55 AM Test Summary: 32413 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7889
-
Alexander Schnitzler commented on patch set 5 12/08/20, 08:58
I would rephrase to something like > ...if unnecessary or > Don't let prototypes implement SingletonInterface. -
Benni Mack uploaded patch set 6 12/08/20, 13:44
-
TYPO3com voted on patch set 6 V -1 12/08/20, 13:56 Completed build in 12m 48s on Tue, 8 Dec, 01:56 PM Test Summary: 31698 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7964
-
TYPO3com voted on patch set 6 V +1 12/08/20, 14:19 Completed build in 47m 54s on Tue, 8 Dec, 02:19 PM Test Summary: 32410 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7964
-
Benni Mack commented on patch set 6 12/08/20, 15:51
Reply
Ack -
Christian Kuhn commented on patch set 6 CR -1 12/08/20, 17:16
on it. -
Christian Kuhn commented on patch set 6 CR 0 12/08/20, 17:33
looks good, asking benni on two details, though. may vote when this is sorted out. -
Alexander Schnitzler commented on patch set 6 CR -1 12/09/20, 09:39
FlexFormService.php:23UnresolvedWhy this? Class is stateless and can be shared.SessionManager.php:37UnresolvedAlso don't agree here. This class is stateless. The only property is only a cache. The problem I have with this class is that it's a mixture of a factory and a service and I would extract the factory method.Services.yaml:71UnresolvedWhy this? Class is stateful and yields different results in mthods depending on its state.HashService.php:29UnresolvedDon't agree here. Class can be shared.ExtensionManagementService.php:34UnresolvedI tend to disagree here. 95% of this class is pure service, reusable and sharable. The inner state can be resolved by passing the property values as parameters to the methods using them.DependencyUtility.php:33UnresolvedPretty much the same as with the ExtensionManagementService. This class shouldn't be called Utility but Service and its inner state should be resolved.EmConfUtility.php:25UnresolvedSame as with DependencyUtility.FileHandlingUtility.php:33UnresolvedAnd again the same like before with the other utilities.InstallUtility.php:50UnresolvedAnd again the same like before with the other utilities.ListUtility.php:39UnresolvedSame like before. $availableExtensions is a property that caches a result. Could easily be static because it doesn't change during runtime. It's either null or with a per request defined state.T3editor.php:33UnresolvedWell, this is a non shared class because it is a configuration factory. I would say there is no harm in having it shared but neither is there any harm having it not shared.CollectionService.php:29UnresolvedI would keep this a service and get rid of the stateful properties which is easily doable. Since those properties are reset already, this class is stateless actually and I would keep it a shared service. -
Benni Mack commented on patch set 6 12/09/20, 10:52
Hey Alex, I would rather define these things (shared & public) via DI than via "SingletonInstance", that was my main reason: Streamline behavior, also make testing simpler. I initially thought this was a good idea, but it seems we disagree on the definition of a why things should or should not be a shared service (or a service in DI at all). This is totally fine with me (no hard feelings), but at the same time I don't think it's worth the effort / discussion now, this was more a "drive-by" work, and no written-down master plan about Singleton / State / DI, which probably needs to be defined first. I suggest we drop this change (I'd be fine with it), and we can pick it up at a later stage then. -
Alexander Schnitzler commented on patch set 6 12/09/20, 11:08
Reply
> I would rather define these things (shared & public) via DI than via "SingletonInstance" I understand, same here. But this change also converts shared instances to non-shared ones. And I don't get the idea about that. imo shared instances are a good thing and a good goal is to have as much as possible. I am fine with talking about that later. -
Benni Mack commented on patch set 6 12/09/20, 11:09
Reply
yes. I think having as few shared instances as possible is good :) but this is a really good example on how to discuss the views of each other. -
Benni Mack abandoned the change 12/09/20, 12:23
Not working on it yet