Skip to content

Commit

Permalink
[TASK] Make some type annotations more specific
Browse files Browse the repository at this point in the history
This change helps static code analyzers like PHPStan or Psalm.

Resolves: #95104
Releases: master, 10.4

Change-Id: I3c5900e57116c3e4e2ba8542a6c0471a372504f8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70886
Tested-by: core-ci <typo3@b13.com>
Tested-by: crell <larry@garfieldtech.com>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: crell <larry@garfieldtech.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Rick Septer <rick.septer@maxserv.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
  • Loading branch information
oliverklee authored and ohader committed Sep 14, 2021
1 parent 74156de commit b482d5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions typo3/sysext/core/Classes/Localization/LanguageStore.php
Expand Up @@ -45,7 +45,7 @@ class LanguageStore implements SingletonInterface
/**
* Parsed localization file
*
* @var array
* @var array<string, array<string, array<string, array<int, array<string, string>>>>>
*/
protected $data;

Expand Down Expand Up @@ -90,7 +90,8 @@ public function hasData($fileReference, $languageKey)
* This method returns all parsed languages for the current file reference.
*
* @param string $fileReference File reference
* @return array
*
* @return array<string, array<string, array<int, array<string, string>>>>
*/
public function getData($fileReference)
{
Expand All @@ -102,7 +103,9 @@ public function getData($fileReference)
*
* @param string $fileReference File reference
* @param string $languageKey Valid language key
* @return array
*
* @return array<string, array<int, array<string, string>>>
*
* @see self::getData()
*/
public function getDataByLanguage($fileReference, $languageKey)
Expand Down
Expand Up @@ -50,7 +50,8 @@ public function __construct(LanguageStore $languageStore, CacheManager $cacheMan
* @param null $_ unused
* @param null $__ unused
* @param bool $isLocalizationOverride TRUE if $fileReference is a localization override
* @return array
*
* @return array<string, array<string, array<int, array<string, string>>>>
*/
public function getParsedData($fileReference, $languageKey, $_ = null, $__ = null, $isLocalizationOverride = false)
{
Expand Down
4 changes: 2 additions & 2 deletions typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php
Expand Up @@ -41,9 +41,9 @@
class AbstractPlugin
{
/**
* The backReference to the mother cObj object set at call time
* The back-reference to the mother cObj object set at call time
*
* @var ContentObjectRenderer
* @var ContentObjectRenderer|null
* @deprecated Set to protected in v12.
* @todo: Signature in v12: protected ?ContentObjectRenderer $cObj = null;
*/
Expand Down

0 comments on commit b482d5d

Please sign in to comment.