Commit 1ac8bbdc authored by Nikita Hovratov's avatar Nikita Hovratov Committed by Christian Kuhn
Browse files

[TASK] Remove redundant @var tags

The type can already be inferred from the source
code.

The cleanup was run automatically with a
PHPStorm plugin.

Resolves: #96482
Releases: main
Change-Id: I669145adc66dc898f3016de1958cf0105c988243
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72907


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 84f22765
......@@ -89,7 +89,6 @@ class Log extends AbstractSubModule implements DataProviderInterface, ModuleSett
$log = InMemoryLogWriter::$log;
$logArray = [];
/** @var \TYPO3\CMS\Core\Log\LogRecord $logRecord */
foreach ($log as $logRecord) {
$entry = $logRecord->toArray();
// store only necessary info
......
......@@ -77,7 +77,6 @@ class PageTitle extends AbstractSubModule implements DataProviderInterface
];
$log = InMemoryLogWriter::$log;
/** @var \TYPO3\CMS\Core\Log\LogRecord $logEntry */
foreach ($log as $logEntry) {
if ($logEntry->getComponent() === self::LOG_COMPONENT) {
if (isset($logEntry->getData()['orderedTitleProviders'])) {
......
......@@ -142,7 +142,6 @@ class OnlineMediaController
/** @var FlashMessageService $flashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
/** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue $defaultFlashMessageQueue */
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
}
......
......@@ -28,7 +28,6 @@ use TYPO3\CMS\Core\Database\RelationHandler;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Resource\FileRepository;
use TYPO3\CMS\Core\Resource\ResourceStorage;
......@@ -283,7 +282,6 @@ abstract class AbstractItemProvider
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $msg, $msgTitle, FlashMessage::ERROR, true);
/** @var FlashMessageService $flashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
/** @var FlashMessageQueue $defaultFlashMessageQueue */
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
return $items;
......
......@@ -412,7 +412,6 @@ class BackendUtilityTest extends UnitTestCase
*/
public function getProcessedValueDisplaysAgeForDateInputFieldsIfSettingAbsent(): void
{
/** @var ObjectProphecy $languageServiceProphecy */
$languageServiceProphecy = $this->prophesize(LanguageService::class);
$languageServiceProphecy->sL(Argument::cetera())->willReturn(' min| hrs| days| yrs| min| hour| day| year');
$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
......@@ -465,7 +464,6 @@ class BackendUtilityTest extends UnitTestCase
*/
public function getProcessedValueHandlesAgeDisplayCorrectly($input, string $expected): void
{
/** @var ObjectProphecy $languageServiceProphecy */
$languageServiceProphecy = $this->prophesize(LanguageService::class);
$languageServiceProphecy->sL(Argument::cetera())->willReturn(' min| hrs| days| yrs| min| hour| day| year');
$GLOBALS['LANG'] = $languageServiceProphecy->reveal();
......
......@@ -1696,7 +1696,6 @@ TCAdefaults.sys_note.email = ' . $this->user['email'];
}
}
if (!$uploadFolder instanceof Folder) {
/** @var ResourceStorage $storage */
foreach ($this->getFileStorages() as $storage) {
if ($storage->isWritable()) {
try {
......
......@@ -2800,7 +2800,6 @@ class DataHandler implements LoggerAwareInterface
$tables = $type === 'group' ? $tcaFieldConf['allowed'] : $tcaFieldConf['foreign_table'];
$prep = $type === 'group' ? ($tcaFieldConf['prepend_tname'] ?? '') : '';
$newRelations = implode(',', $valueArray);
/** @var RelationHandler $dbAnalysis */
$dbAnalysis = $this->createRelationHandlerInstance();
$dbAnalysis->registerNonTableValues = !empty($tcaFieldConf['allowNonIdValues']);
$dbAnalysis->start($newRelations, $tables, '', 0, $currentTable, $tcaFieldConf);
......@@ -2809,7 +2808,6 @@ class DataHandler implements LoggerAwareInterface
// (only required for MM relations in a workspace context)
$dbAnalysis->convertItemArray();
if ($status === 'update') {
/** @var RelationHandler $oldRelations_dbAnalysis */
$oldRelations_dbAnalysis = $this->createRelationHandlerInstance();
$oldRelations_dbAnalysis->registerNonTableValues = !empty($tcaFieldConf['allowNonIdValues']);
// Db analysis with $id will initialize with the existing relations
......@@ -3038,7 +3036,6 @@ class DataHandler implements LoggerAwareInterface
$foreignTable = $tcaFieldConf['foreign_table'];
$valueArray = $this->applyFiltersToValues($tcaFieldConf, $valueArray);
// Fetch the related child records using \TYPO3\CMS\Core\Database\RelationHandler
/** @var RelationHandler $dbAnalysis */
$dbAnalysis = $this->createRelationHandlerInstance();
$dbAnalysis->start(implode(',', $valueArray), $foreignTable, '', 0, $table, $tcaFieldConf);
// IRRE with a pointer field (database normalization):
......@@ -3187,7 +3184,6 @@ class DataHandler implements LoggerAwareInterface
}
}
}
/** @var DataHandler $copyTCE */
$copyTCE = $this->getLocalTCE();
$copyTCE->start($pasteDatamap, [], $this->BE_USER);
$copyTCE->process_datamap();
......@@ -3328,7 +3324,6 @@ class DataHandler implements LoggerAwareInterface
$data[$table][$theNewID][$GLOBALS['TCA'][$table]['ctrl']['origUid']] = $uid;
}
// Do the copy by simply submitting the array through DataHandler:
/** @var DataHandler $copyTCE */
$copyTCE = $this->getLocalTCE();
$copyTCE->start($data, [], $this->BE_USER);
$copyTCE->process_datamap();
......@@ -3828,7 +3823,6 @@ class DataHandler implements LoggerAwareInterface
array $workspaceOptions
) {
// Fetch the related child records using \TYPO3\CMS\Core\Database\RelationHandler
/** @var RelationHandler $dbAnalysis */
$dbAnalysis = $this->createRelationHandlerInstance();
$dbAnalysis->start($value, $conf['foreign_table'], '', $uid, $table, $conf);
// Walk through the items, copy them and remember the new id:
......@@ -4678,7 +4672,6 @@ class DataHandler implements LoggerAwareInterface
$removeArray = [];
$mmTable = $inlineSubType === 'mm' && isset($config['MM']) && $config['MM'] ? $config['MM'] : '';
// Fetch children from original language parent:
/** @var RelationHandler $dbAnalysisOriginal */
$dbAnalysisOriginal = $this->createRelationHandlerInstance();
$dbAnalysisOriginal->start($transOrigRecord[$field], $foreignTable, $mmTable, $transOrigRecord['uid'], $table, $config);
$elementsOriginal = [];
......@@ -4687,7 +4680,6 @@ class DataHandler implements LoggerAwareInterface
}
unset($dbAnalysisOriginal);
// Fetch children from current localized parent:
/** @var RelationHandler $dbAnalysisCurrent */
$dbAnalysisCurrent = $this->createRelationHandlerInstance();
$dbAnalysisCurrent->start($parentRecord[$field], $foreignTable, $mmTable, $id, $table, $config);
// Perform synchronization: Possibly removal of already localized records:
......@@ -5250,7 +5242,6 @@ class DataHandler implements LoggerAwareInterface
if ($foreign_table) {
$inlineType = $this->getInlineFieldType($conf);
if ($inlineType === 'list' || $inlineType === 'field') {
/** @var RelationHandler $dbAnalysis */
$dbAnalysis = $this->createRelationHandlerInstance();
$dbAnalysis->start($value, $conf['foreign_table'], '', $uid, $table, $conf);
$dbAnalysis->undeleteRecord = true;
......@@ -6281,7 +6272,6 @@ class DataHandler implements LoggerAwareInterface
if ($inlineType === 'mm') {
$this->remapListedDBRecords_procDBRefs($conf, $value, $theUidToUpdate, $table);
} elseif ($inlineType !== false) {
/** @var RelationHandler $dbAnalysis */
$dbAnalysis = $this->createRelationHandlerInstance();
$dbAnalysis->start($value, $conf['foreign_table'], '', 0, $table, $conf);
......@@ -8641,7 +8631,6 @@ class DataHandler implements LoggerAwareInterface
}
}
/** @var CacheManager $cacheManager */
$cacheManager = $this->getCacheManager();
$cacheManager->flushCachesInGroupByTags('pages', array_keys($tagsToClear));
......
......@@ -19,7 +19,6 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -57,7 +56,6 @@ class BackendUserGroupIntegrityCheck
);
/** @var FlashMessageService $flashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
/** @var FlashMessageQueue $defaultFlashMessageQueue */
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
}
......
......@@ -822,7 +822,6 @@ class PackageManager implements SingletonInterface
throw new InvalidPackageStateException('Package "' . $packageKey . '" is not registered.', 1436201329);
}
/** @var PackageInterface $package */
$package = $this->packages[$packageKey];
$packagePath = $package->getPackagePath();
$newPackage = new Package($this, $packageKey, $packagePath);
......
......@@ -65,7 +65,6 @@ class ExtractorRegistry implements SingletonInterface
$extractors = array_reverse($this->extractors);
foreach ($extractors as $className) {
/** @var ExtractorInterface $object */
$object = $this->createExtractorInstance($className);
$this->instances[] = $object;
}
......
......@@ -119,7 +119,6 @@ final class FileDeletionAspect
return;
}
/** @var \TYPO3\CMS\Core\Resource\ProcessedFile $processedFile */
foreach ($this->getProcessedFileRepository()->findAllByOriginalFile($fileObject) as $processedFile) {
if ($processedFile->exists()) {
$processedFile->delete(true);
......
......@@ -70,7 +70,6 @@ class RendererRegistry implements SingletonInterface
// priority in the same order as they were added to the registry.
$classNames = array_reverse($this->classNames);
foreach ($classNames as $className) {
/** @var FileRendererInterface $object */
$object = $this->createRendererInstance($className);
$this->instances[] = $object;
}
......@@ -118,7 +117,6 @@ class RendererRegistry implements SingletonInterface
{
$matchingFileRenderer = null;
/** @var FileRendererInterface $fileRenderer */
foreach ($this->getRendererInstances() as $fileRenderer) {
if ($fileRenderer->canRender($file)) {
$matchingFileRenderer = $fileRenderer;
......
......@@ -1205,7 +1205,6 @@ class ExtendedFileUtility extends BasicFileUtility
/** @var FlashMessageService $flashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
/** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue $defaultFlashMessageQueue */
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
}
......
......@@ -157,7 +157,6 @@ class LogRecordTest extends UnitTestCase
$level = LogLevel::DEBUG;
$message = 'test message';
$data = ['foo' => 'bar'];
/** @var $record LogRecord */
$record = new LogRecord($component, $level, $message, $data);
$recordArray = $record->toArray();
self::assertEquals($component, $recordArray['component']);
......
......@@ -1402,7 +1402,6 @@ class LocalDriverTest extends BaseTestCase
'targetFolder' => [],
]);
$subject = $this->createDriver();
/** @var LocalDriver $subject */
$subject->moveFolderWithinStorage('/sourceFolder/', '/targetFolder/', 'someFolder');
self::assertFileExists($this->getUrlInMount('/targetFolder/someFolder/'));
self::assertEquals($fileContents, file_get_contents($this->getUrlInMount('/targetFolder/someFolder/file')));
......
......@@ -546,7 +546,6 @@ class ResourceStorageTest extends BaseTestCase
$mockedDriver = $this->createDriverMock([], $this->subject, ['renameFile']);
$mockedDriver->expects(self::once())->method('renameFile')->willReturn('bar');
$this->prepareSubject([], true, $mockedDriver, null);
/** @var File $file */
$file = new File(['identifier' => 'foo', 'name' => 'foo'], $this->subject);
$result = $this->subject->renameFile($file, 'bar');
// fake what the indexer does in updateIndexEntry
......@@ -577,7 +576,6 @@ class ResourceStorageTest extends BaseTestCase
['getUniqueName', 'createFolderObject']
);
$this->subject->expects(self::once())->method('createFolderObject')->willReturn(new Folder($this->subject, '', ''));
/** @var File $file */
$file = new File(['identifier' => 'foo', 'name' => 'foo'], $this->subject);
$this->subject->method('getUniqueName')->willReturn('bar_01');
$result = $this->subject->renameFile($file, 'bar');
......@@ -597,7 +595,6 @@ class ResourceStorageTest extends BaseTestCase
1489593099
)));
$this->prepareSubject([], true, $mockedDriver);
/** @var File $file */
$file = new File(['identifier' => 'foo', 'name' => 'foo'], $this->subject);
$this->expectException(ExistingTargetFileNameException::class);
$this->subject->renameFile($file, 'bar', DuplicationBehavior::CANCEL);
......@@ -623,7 +620,6 @@ class ResourceStorageTest extends BaseTestCase
$file = $this->prophesize(FileInterface::class);
$resourceFactory->getFileObjectFromCombinedIdentifier(Argument::any())->willReturn($file->reveal());
$this->subject->expects(self::once())->method('replaceFile')->willReturn($file->reveal());
/** @var File $file */
$file = new File(['identifier' => 'foo', 'name' => 'foo', 'missing' => false], $this->subject);
$this->subject->renameFile($file, 'bar', DuplicationBehavior::REPLACE);
}
......
......@@ -110,7 +110,6 @@ class DashboardInitializationService
$userConfig['options.']['dashboard.']['dashboardPresetsForNewUsers'] ?? 'default'
);
/** @var DashboardPreset $dashboardPreset */
foreach ($this->dashboardPresetRegistry->getDashboardPresets() as $dashboardPreset) {
if (in_array($dashboardPreset->getIdentifier(), $dashboardsToCreate, true)) {
$dashboard = $this->dashboardRepository->create(
......
......@@ -338,8 +338,6 @@ class ClassSchema
$docComment = is_string($docComment) ? $docComment : '';
foreach ($reflectionMethod->getParameters() as $parameterPosition => $reflectionParameter) {
/* @var \ReflectionParameter $reflectionParameter */
$parameterName = $reflectionParameter->getName();
$ignoreValidationParameters = array_filter($annotations, static function ($annotation) use ($parameterName) {
......
......@@ -22,7 +22,6 @@ use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Annotation as Extbase;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Mvc\Controller\Arguments;
use TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration;
use TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter;
/**
......@@ -37,7 +36,6 @@ class TestController extends ActionController
public function initializeFooAction(): void
{
/** @var MvcPropertyMappingConfiguration $propertyMappingConfiguration */
$propertyMappingConfiguration = $this->arguments['fooParam']->getPropertyMappingConfiguration();
$propertyMappingConfiguration->allowAllProperties();
$propertyMappingConfiguration->setTypeConverterOption(
......
......@@ -223,7 +223,6 @@ class RelationTest extends FunctionalTestCase
->execute()
->fetchOne();
/** @var Post $newPost */
$newPost = new Post();
$posts = clone $this->blog->getPosts();
......
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