Commit ed804b42 authored by crell's avatar crell Committed by Stefan Bürk
Browse files

[!!!][TASK] Add property types to FileLinkHandler

Doing so also allows for a bit of code cleanup.

Used command:

> ./Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Resolves: #97982
Releases: main
Change-Id: Id351fda2040fd7de3931a109b77ff0c947c552b3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75251

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent e53c7f64
......@@ -815,11 +815,6 @@ parameters:
count: 1
path: ../../typo3/sysext/core/Classes/Imaging/ImageManipulation/CropVariant.php
-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/LinkHandling/FileLinkHandler.php
-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
......
......@@ -29,18 +29,15 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
*/
class FileLinkHandler implements LinkHandlingInterface
{
/**
* The Base URN
* @var string
*/
protected $baseUrn = 't3://file';
protected string $baseUrn = 't3://file';
/**
* The resource factory object to resolve file objects
* @var ResourceFactory
*/
protected $resourceFactory;
protected ResourceFactory $resourceFactory;
/**
* Returns the link to a file as a string
......@@ -111,9 +108,6 @@ class FileLinkHandler implements LinkHandlingInterface
*/
protected function getResourceFactory(): ResourceFactory
{
if (!$this->resourceFactory) {
$this->resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
}
return $this->resourceFactory;
return $this->resourceFactory ??= GeneralUtility::makeInstance(ResourceFactory::class);
}
}
......@@ -13,6 +13,7 @@ The following PHP classes have had parameter and return types added to some or
all of their method signatures. The types are consistent with existing
docblock-documented type expectations and existing behavior.
- :php:`\TYPO3\CMS\Core\LinkHandling\FileLinkHandler`
- :php:`\TYPO3\CMS\Core\Utility\ArrayUtility`
- :php:`\TYPO3\CMS\Core\Utility\ClassNamingUtility`
- :php:`\TYPO3\CMS\Core\Utility\CsvUtility`
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment