Skip to content

Commit

Permalink
[TASK] Remove redundant type casts in ext:form
Browse files Browse the repository at this point in the history
Some type casts in ext:form are superfluous, since it is
already ensured, that the variable type is as expected.

This change removes all redundant type casts.

Resolves: #102840
Releases: main
Change-Id: I0daa178ab69c88e61bc92f31caefd9f8b45766df
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82461
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
derhansen authored and o-ba committed Jan 17, 2024
1 parent adc1a4a commit df3de41
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
Expand Up @@ -860,7 +860,7 @@ public function getType(): string
public function offsetExists(mixed $identifier): bool
{
$identifier = (string)$identifier;
if ($this->getElementValue((string)$identifier) !== null) {
if ($this->getElementValue($identifier) !== null) {
return true;
}

Expand Down
Expand Up @@ -54,12 +54,12 @@ public function __sleep(): array
return ['_uid'];
}
if ($this->getOriginalResource()->getUid() > 0) {
$this->_uid = (int)$this->getOriginalResource()->getUid();
$this->_uid = $this->getOriginalResource()->getUid();
return ['_uid'];
}
// in case this is a transient file reference, just expose the associated `sys_file.uid`
// (based on previous comments, this is the most probably case in ext:form)
$this->_uidLocal = (int)$this->getOriginalResource()->getOriginalFile()->getUid();
$this->_uidLocal = $this->getOriginalResource()->getOriginalFile()->getUid();
return ['_uidLocal'];
}

Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/form/Classes/Slot/FilePersistenceSlot.php
Expand Up @@ -238,7 +238,7 @@ protected function assertFileName(

$contentSignature = null;
if ($content !== null) {
$contentSignature = $this->getContentSignature((string)$content);
$contentSignature = $this->getContentSignature($content);
}
$allowedInvocationIndex = $this->searchAllowedInvocation(
$command,
Expand Down

0 comments on commit df3de41

Please sign in to comment.