Commit b8feea36 authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Benni Mack
Browse files

[TASK] Fix php doc comments reported by phpstan level 2

Releases: master
Resolves: #90668
Change-Id: I92cc4942f9f06d587a7957a94f006d157143e55c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63569

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent cef99dd2
......@@ -3,6 +3,15 @@ includes:
# Include bleeding edge rules if necessary but do not commit
# - vendor/phpstan/phpstan/conf/bleedingEdge.neon
rules:
# those are level 2 rules, will be removed once level 2 is completely active
- PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeRule
- PHPStan\Rules\PhpDoc\IncompatiblePropertyPhpDocTypeRule
- PHPStan\Rules\PhpDoc\InvalidPhpDocTagValueRule
- PHPStan\Rules\PhpDoc\InvalidPHPStanDocTagRule
- PHPStan\Rules\PhpDoc\InvalidThrowsPhpDocValueRule
- PHPStan\Rules\PhpDoc\WrongVariableNameInVarTagRule
parameters:
level: 1
......
......@@ -111,7 +111,7 @@ class ConfigurationService implements SingletonInterface
/**
* @param array $modules
* @param \Psr\Http\Message\ServerRequestInterface $request
* @param $configurationToSave
* @param array $configurationToSave
*/
protected function triggerOnSubmitActors(
array $modules,
......
......@@ -407,7 +407,7 @@ class PasswordReset implements LoggerAwareInterface
* @param int $error see SystemLogErrorClassification
* @param int $userId
* @param array $data additional information, used for the message
* @param $ipAddress
* @param string $ipAddress
* @param Context $context
*/
protected function log(string $message, int $action, int $error, int $userId, array $data, $ipAddress, Context $context): void
......
......@@ -179,7 +179,7 @@ class BackendController
/**
* Main function generating the BE scaffolding
*
* @param $request ServerRequestInterface
* @param ServerRequestInterface $request
* @return ResponseInterface the response with the content
*/
public function mainAction(ServerRequestInterface $request): ResponseInterface
......
......@@ -970,7 +970,7 @@ class PageLayoutController
/**
* Check if page can be edited by current user
*
* @param int|null $languageId
* @param int $languageId
* @return bool
*/
protected function isPageEditable(int $languageId): bool
......
......@@ -335,7 +335,7 @@ abstract class AbstractFormElement extends AbstractNode
* Calculates the bootstrap grid classes based on the amount of columns
* defined in the checkbox item TCA
*
* @param $cols
* @param int $cols
* @return array
* @internal
*/
......
......@@ -99,7 +99,7 @@ class TcaCheckboxItems extends AbstractItemProvider implements FormDataProviderI
/**
* @param string $fieldName
* @param string $tableName
* @param $checkboxEntry
* @param mixed $checkboxEntry
* @param int $checkboxKey
* @throws \UnexpectedValueException
*/
......
......@@ -429,7 +429,7 @@ class ModuleTemplate
/**
* Generates the Menu for things like Web->Info
*
* @param $moduleMenuIdentifier
* @param string $moduleMenuIdentifier
* @return self
*/
public function registerModuleMenu($moduleMenuIdentifier): self
......
......@@ -352,7 +352,7 @@ class AuthenticationService extends AbstractAuthenticationService
* parameters. The syntax is the same as for sprintf()
*
* @param string $message Message to output
* @param array|mixed[] $params
* @param array<int,mixed> $params
*/
protected function writeLogMessage(string $message, ...$params): void
{
......
......@@ -481,7 +481,7 @@ class Typo3DatabaseBackend extends AbstractBackend implements TaggableBackendInt
* If compression is enabled and this is not set,
* gzcompress default level will be used
*
* @param int -1 to 9: Compression level
* @param int $compressionLevel -1 to 9: Compression level
*/
public function setCompressionLevel($compressionLevel)
{
......
......@@ -264,7 +264,7 @@ abstract class AbstractRecordCollection implements RecordCollectionInterface, Pe
* The comparison function given as must return an integer less than, equal to, or greater than
* zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
*
* @param $callbackFunction
* @param callable $callbackFunction
* @see http://www.php.net/manual/en/function.usort.php
*/
public function usort($callbackFunction)
......
......@@ -31,7 +31,7 @@ interface SortableCollectionInterface
* The comparison function given as must return an integer less than, equal to, or greater than
* zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
*
* @param $callbackFunction
* @param callable $callbackFunction
* @see http://www.php.net/manual/en/function.usort.php
*/
public function usort($callbackFunction);
......
......@@ -57,7 +57,7 @@ class Context implements SingletonInterface
/**
* Sets up the context with pre-defined aspects
*
* @param array|null $defaultAspects
* @param array $defaultAspects
*/
public function __construct(array $defaultAspects = [])
{
......
......@@ -607,7 +607,7 @@ class Bootstrap
*/
public static function initializeLanguageObject()
{
/** @var $GLOBALS['LANG'] \TYPO3\CMS\Core\Localization\LanguageService */
/** @var \TYPO3\CMS\Core\Localization\LanguageService $GLOBALS['LANG'] */
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
}
}
......@@ -411,7 +411,7 @@ class SystemEnvironmentBuilder
/**
* Define constants and variables
*
* @param string
* @param string $mode
*/
protected static function defineLegacyConstants(string $mode)
{
......
......@@ -2407,7 +2407,7 @@ class DataHandler implements LoggerAwareInterface
* @param string $field Field name for which $value must be unique
* @param int $uid UID to filter out in the lookup (the record itself...)
* @param int $pid If set, the value will be unique for this PID
* @return \Doctrine\DBAL\Driver\Statement|int Return the prepared statement to check uniqueness
* @return \Doctrine\DBAL\Driver\Statement Return the prepared statement to check uniqueness
*/
protected function getUniqueCountStatement(
string $value,
......@@ -7601,7 +7601,6 @@ class DataHandler implements LoggerAwareInterface
/**
* Check if there are subpages that need an adoption as well
* @param int $pageId
* @param int $pid
*/
protected function fixUniqueInSiteForSubpages(int $pageId)
{
......
......@@ -82,7 +82,7 @@ class RecordHistoryStore
* @param string $table
* @param int $uid
* @param array $payload
* @param string|null $correlationId
* @param CorrelationId|null $correlationId
* @return string
*/
public function addRecord(string $table, int $uid, array $payload, CorrelationId $correlationId = null): string
......@@ -107,7 +107,7 @@ class RecordHistoryStore
* @param string $table
* @param int $uid
* @param array $payload
* @param string|null $correlationId
* @param CorrelationId|null $correlationId
* @return string
*/
public function modifyRecord(string $table, int $uid, array $payload, CorrelationId $correlationId = null): string
......@@ -131,7 +131,7 @@ class RecordHistoryStore
/**
* @param string $table
* @param int $uid
* @param string|null $correlationId
* @param CorrelationId|null $correlationId
* @return string
*/
public function deleteRecord(string $table, int $uid, CorrelationId $correlationId = null): string
......@@ -154,7 +154,7 @@ class RecordHistoryStore
/**
* @param string $table
* @param int $uid
* @param string|null $correlationId
* @param CorrelationId|null $correlationId
* @return string
*/
public function undeleteRecord(string $table, int $uid, CorrelationId $correlationId = null): string
......@@ -178,7 +178,7 @@ class RecordHistoryStore
* @param string $table
* @param int $uid
* @param array $payload
* @param string|null $correlationId
* @param CorrelationId|null $correlationId
* @return string
*/
public function moveRecord(string $table, int $uid, array $payload, CorrelationId $correlationId = null): string
......
......@@ -1317,7 +1317,7 @@ class DataMapProcessor
* Prefixes language title if applicable for the accordant field name in raw data-map item.
*
* @param string $tableName
* @param $fromId
* @param string|int $fromId
* @param int $language
* @param array $data
* @return array
......
......@@ -52,7 +52,7 @@ class RecordStateFactory
* @param array $data
* @param int|string|null $pageId
* @param int|string|null $recordId
* @return object|RecordState
* @return RecordState
*/
public function fromArray(array $data, $pageId = null, $recordId = null): RecordState
{
......
......@@ -62,7 +62,7 @@ class ExpressionBuilder
/**
* Creates a conjunction of the given boolean expressions
*
* @param mixed $expressions Optional clause. Requires at least one defined when converting to string.
* @param array<int,mixed> $expressions Optional clause. Requires at least one defined when converting to string.
*
* @return CompositeExpression
*/
......@@ -74,7 +74,7 @@ class ExpressionBuilder
/**
* Creates a disjunction of the given boolean expressions.
*
* @param mixed $expressions Optional clause. Requires at least one defined when converting to string.
* @param array<int,mixed> $expressions Optional clause. Requires at least one defined when converting to string.
*
* @return CompositeExpression
*/
......
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