Skip to content

Commit fbfcdff

Browse files
simonschaufigeorgringer
authored andcommitted
[BUGFIX] Always set the validator for an argument in extbase
Fix also a wrong annotation for initialize methods. This patch will also remove two entries in the phpstan baseline. Resolves: #106310 Releases: main Change-Id: I3a2c845ab6c248cd6b56d43f9400185e5150cdff Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/88496 Tested-by: Benni Mack <benni@typo3.org> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Georg Ringer <georg.ringer@gmail.com> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Georg Ringer <georg.ringer@gmail.com>
1 parent 4916a0b commit fbfcdff

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

Build/phpstan/phpstan-baseline.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,18 +2280,6 @@ parameters:
22802280
count: 1
22812281
path: ../../typo3/sysext/extbase/Classes/Annotation/IgnoreValidation.php
22822282

2283-
-
2284-
message: '#^Call to function is_callable\(\) with callable\(\)\: mixed will always evaluate to true\.$#'
2285-
identifier: function.alreadyNarrowedType
2286-
count: 1
2287-
path: ../../typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
2288-
2289-
-
2290-
message: '#^Strict comparison using \!\=\= between TYPO3\\CMS\\Extbase\\Validation\\Validator\\ConjunctionValidator and null will always evaluate to true\.$#'
2291-
identifier: notIdentical.alwaysTrue
2292-
count: 1
2293-
path: ../../typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
2294-
22952283
-
22962284
message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#'
22972285
identifier: function.alreadyNarrowedType

typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,7 @@ public function initializeControllerArgumentsBaseValidators(): void
328328
$argument->getDataType(),
329329
$this->request
330330
);
331-
if ($validator !== null) {
332-
$argument->setValidator($validator);
333-
}
331+
$argument->setValidator($validator);
334332
}
335333
}
336334

@@ -352,7 +350,7 @@ public function processRequest(RequestInterface $request): ResponseInterface
352350
$this->fileHandlingService->initializeFileUploadConfigurationsFromRequest($request, $this->arguments);
353351
$this->initializeAction();
354352
$actionInitializationMethodName = 'initialize' . ucfirst($this->actionMethodName);
355-
/** @var callable $callable */
353+
/** @var callable|null $callable */
356354
$callable = [$this, $actionInitializationMethodName];
357355
if (is_callable($callable)) {
358356
$callable();

0 commit comments

Comments
 (0)