74652[!!!][TASK] Add types to Scheduler Tasks
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 20
- Build/phpstan/phpstan-baseline.neon+0 −5
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-97210-TypesAddedToMethodSignaturesOrClassProperties.rst+5 −0
- typo3/sysext/extensionmanager/Classes/Task/UpdateExtensionListTask.php+2 −5
- typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php2+24 −91
- typo3/sysext/recycler/Classes/Task/CleanerTask.php2+20 −28
- typo3/sysext/reports/Classes/Task/SystemStatusUpdateTask.php+9 −21
- typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php+1 −1
- typo3/sysext/scheduler/Classes/Example/SleepTask.php+6 −12
- typo3/sysext/scheduler/Classes/Example/TestTask.php+5 −5
- typo3/sysext/scheduler/Classes/Task/AbstractTask.php15+40 −76
- typo3/sysext/scheduler/Classes/Task/CachingFrameworkGarbageCollectionTask.php+5 −5
- typo3/sysext/scheduler/Classes/Task/ExecuteSchedulableCommandTask.php+10 −35
- typo3/sysext/scheduler/Classes/Task/FileStorageExtractionTask.php6+7 −22
- typo3/sysext/scheduler/Classes/Task/FileStorageIndexingTask.php4+6 −15
- typo3/sysext/scheduler/Classes/Task/IpAnonymizationTask.php2+8 −12
- typo3/sysext/scheduler/Classes/Task/OptimizeDatabaseTableTask.php2+6 −8
- typo3/sysext/scheduler/Classes/Task/RecyclerGarbageCollectionTask.php+3 −5
- typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php+11 −12
- typo3/sysext/scheduler/Classes/Scheduler.php+0 −4
- typo3/sysext/scheduler/Tests/Unit/Task/Fixtures/TestTask.php+2 −1
Review log 1316
-
crell uploaded patch set 1 05/16/22, 18:46
-
core-ci voted on patch set 1 V -1 05/16/22, 18:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27259
-
Oliver Klee commented on patch set 1 05/16/22, 18:57
CleanerTask.php:156We can annotate this with string[] to be consistent to the annotation of the property. Ditto for the getter. -
crell commented on patch set 1 05/16/22, 19:31
ValidatorTask.php:46Reply UnresolvedThere's no direct way to mimic the old behavior. They would have evaluated to null, but then are concatenated into a string for a CLI command, so would have cast to empty string. Setting them to 0 may or may not be the same thing. (It probably is not.) I can set them to 0, but that doesn't actually do anything useful. If anything, it hides what should be an error case by passing 0 to the command line, which may or may not do something useful. Leaving them unset would at least generate an error if they're used while unset. Unless someone can confirm that 0 is reasonable default settings for the CLI command that gets run? If so, then it's fine. (They're only used in setCliArguments(), I think.)CleanerTask.php:156ReplyDone -
crell uploaded patch set 2 05/16/22, 19:31
-
core-ci voted on patch set 2 V +1 05/16/22, 19:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27261
-
Oliver Klee commented on patch set 2 05/17/22, 11:38
AbstractTask.php:44This comment is redundant with the type declaration, and we can remove it.AbstractTask.php:46As this property is set in the constructor, it does not need to be nullable.AbstractTask.php:288int $timestampAbstractTask.php:310: voidAbstractTask.php:558We can make this PHPStan-readable: int<self::TYPE_SINGLE, self::TYPE_RECURRING> See: https://phpstan.org/writing-php-code/phpdoc-types#integer-rangesAbstractTask.php:569We can drop this annotation.FileStorageExtractionTask.php:32We can drop this comment as it's redundant.FileStorageExtractionTask.php:37Ditto.FileStorageExtractionTask.php:70Ditto.FileStorageIndexingTask.php:32We can remove this comment as it's redundant.FileStorageIndexingTask.php:58We can remove this comment as it's redundant.IpAnonymizationTask.php:38We can remove this comment as it's redundant.OptimizeDatabaseTableTask.php:72We can remove this annotation as it's redundant. -
crell commented on patch set 2 05/17/22, 14:19
AbstractTask.php:44ReplyDoneAbstractTask.php:46ReplyDoneAbstractTask.php:288ReplyDoneAbstractTask.php:310ReplyDoneAbstractTask.php:558ReplyOo, nifty. (Ideally we'd convert this to an enum, but that's for another patch.)AbstractTask.php:569ReplyDoneFileStorageExtractionTask.php:32ReplyDoneFileStorageExtractionTask.php:37ReplyDoneFileStorageExtractionTask.php:70ReplyDoneFileStorageIndexingTask.php:32ReplyDoneFileStorageIndexingTask.php:58ReplyDoneIpAnonymizationTask.php:38ReplyDoneOptimizeDatabaseTableTask.php:72ReplyDone -
crell commented on patch set 2 05/17/22, 14:57
AbstractTask.php:46ReplyActually, nope. The unsetScheduler() method explicitly sets it to null. (I have no idea why that's there, it's probably the wrong way to do whatever it's doing, but that's a separate issue.) -
crell uploaded patch set 3 05/17/22, 14:58
-
core-ci voted on patch set 3 V +1 05/17/22, 15:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27282
-
Oliver Klee commented on patch set 3 05/17/22, 15:43
AbstractTask.php:46ReplyAck -
Oliver Klee voted on patch set 3 CR +1 05/17/22, 15:45
-
Oliver Klee wrote 05/18/22, 19:41
Removed reviewer Oliver Klee with the following votes: * Code-Review+1 by Oliver Klee -
Stefan Bürk commented on patch set 3 05/18/22, 22:48
AbstractTask.php:46ReplyTasks are serialized/unserialzied in the database (not a good way). @lolli already mentioned this recently in the core dev channel. This should be changed. Thus property must be nullable so it can be unset. Beside this, it's commented in the method: ``` /** * Unsets the internal reference to the singleton instance of the Scheduler * and the logger instance. * This is done before a task is serialized, so that the scheduler instance * and the logger instance are not saved to the database */ ``` -
crell abandoned the change 08/01/22, 18:04
Apparently scheduler is slated for removal anyway.
ValidatorTask.php:46