Commit 033a5922 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Minor annotation and sanitation improvements

Various changes throughout the system improving
method annotations here and there or sanitizing
code a bit better.

Change-Id: Ieeee41ede160e301a59aa8a534ca26e3499a4fcd
Resolves: #83612
Releases: master
Reviewed-on: https://review.typo3.org/55411

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarReiner Teubner <reiner.teubner@me.com>
Reviewed-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 950219d5
......@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Domain\Model\Module\BackendModule;
use TYPO3\CMS\Backend\Domain\Repository\Module\BackendModuleRepository;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -25,7 +26,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
class HelpToolbarItem implements ToolbarItemInterface
{
/**
* @var \SplObjectStorage<BackendModule>
* @var BackendModule
*/
protected $helpModuleMenu = null;
......
......@@ -431,7 +431,7 @@ class Clipboard
'removeLink' => $this->removeUrl($table, $uid)
];
$localizationData = $this->getLocalizations($table, $rec, '', '');
$localizationData = $this->getLocalizations($table, $rec);
if (!empty($localizationData)) {
$lines = array_merge($lines, $localizationData);
}
......@@ -468,11 +468,9 @@ class Clipboard
*
* @param string $table The table
* @param array $parentRec The current record
* @param string $bgColClass Class for the background color of a column
* @param string $pad Pad reference
* @return string HTML table rows
* @return array HTML table rows
*/
public function getLocalizations($table, $parentRec, $bgColClass, $pad)
public function getLocalizations($table, $parentRec)
{
$lines = [];
$tcaCtrl = $GLOBALS['TCA'][$table]['ctrl'];
......@@ -944,7 +942,7 @@ class Clipboard
*
* @param string $ref [tablename]:[paste-uid], see description
* @param array $CMD Command-array
* @param array|null If additional values should get set in the copied/moved record this will be an array containing key=>value pairs
* @param array|null $update If additional values should get set in the copied/moved record this will be an array containing key=>value pairs
* @return array Modified Command-array
*/
public function makePasteCmdArray($ref, $CMD, array $update = null)
......
......@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Backend\Controller;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\FormProtection\FormProtectionFactory;
use TYPO3\CMS\Core\Http\JsonResponse;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -40,7 +41,8 @@ class AjaxLoginController
if ($this->isAuthorizedBackendSession()) {
$result = ['success' => true];
if ($this->hasLoginBeenProcessed()) {
$formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
/** @var \TYPO3\CMS\Core\FormProtection\BackendFormProtection $formProtection */
$formProtection = FormProtectionFactory::get();
$formProtection->setSessionTokenFromRegistry();
$formProtection->persistSessionToken();
}
......
......@@ -23,6 +23,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Resource\AbstractFile;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
......@@ -168,7 +169,7 @@ class ElementInformationController
$this->folderObject = $fileOrFolderObject;
$this->access = $this->folderObject->checkActionPermission('read');
$this->type = 'folder';
} else {
} elseif ($fileOrFolderObject instanceof File) {
$this->fileObject = $fileOrFolderObject;
$this->access = $this->fileObject->checkActionPermission('read');
$this->type = 'file';
......
......@@ -1830,7 +1830,7 @@ class EditDocumentController
*
* @param string $table Table name
* @param int $theUid Record UID
* @return array Returns record to edit, FALSE if none
* @return array|false Returns record to edit, FALSE if none
*/
public function getRecordForEdit($table, $theUid)
{
......
......@@ -72,6 +72,7 @@ trait PublicPropertyDeprecationTrait
*
* This method is not called for public properties.
*
* @property array $deprecatedPublicProperties List of deprecated public properties
* @param string $propertyName
* @return bool
*/
......@@ -90,6 +91,7 @@ trait PublicPropertyDeprecationTrait
* The evaluation is done in the assumption that this method is never
* reached for a public property.
*
* @property array $deprecatedPublicProperties List of deprecated public properties
* @param string $propertyName
* @return mixed
*/
......@@ -109,6 +111,7 @@ trait PublicPropertyDeprecationTrait
* The evaluation is done in the assumption that this method is never
* reached for a public property.
*
* @property array $deprecatedPublicProperties List of deprecated public properties
* @param string $propertyName
* @param mixed $propertyValue
*/
......@@ -124,6 +127,7 @@ trait PublicPropertyDeprecationTrait
/**
* Unsets the property of the given name if tagged.
*
* @property array $deprecatedPublicProperties List of deprecated public properties
* @param string $propertyName
*/
public function __unset(string $propertyName)
......
......@@ -54,7 +54,6 @@ class Logger implements \Psr\Log\LoggerInterface
* Constructor.
*
* @param string $name A name for the logger.
* @return \TYPO3\CMS\Core\Log\Logger
*/
public function __construct($name)
{
......
......@@ -629,7 +629,7 @@ class ExtendedFileUtility extends BasicFileUtility
* $cmds['altName'] (string): Use an alternative name if the target already exists
*
* @param array $cmds Command details as described above
* @return \TYPO3\CMS\Core\Resource\File
* @return \TYPO3\CMS\Core\Resource\File|false
*/
protected function func_copy($cmds)
{
......@@ -719,7 +719,7 @@ class ExtendedFileUtility extends BasicFileUtility
* $cmds['altName'] (string): Use an alternative name if the target already exists
*
* @param array $cmds Command details as described above
* @return \TYPO3\CMS\Core\Resource\File
* @return \TYPO3\CMS\Core\Resource\File|false
*/
protected function func_move($cmds)
{
......@@ -882,7 +882,7 @@ class ExtendedFileUtility extends BasicFileUtility
* + example "2:targetpath/targetfolder/"
*
* @param array $cmds Command details as described above
* @return \TYPO3\CMS\Core\Resource\Folder Returns the new foldername upon success
* @return \TYPO3\CMS\Core\Resource\Folder|false Returns the new foldername upon success
*/
public function func_newfolder($cmds)
{
......
......@@ -15,6 +15,8 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Importer;
*/
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser;
/**
* Importer object for extension list
......@@ -24,7 +26,7 @@ class ExtensionListUtility implements \SplObserver
/**
* Keeps instance of a XML parser.
*
* @var \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser
* @var AbstractExtensionXmlParser
*/
protected $parser;
......@@ -101,6 +103,11 @@ class ExtensionListUtility implements \SplObserver
*/
protected $extensionModel;
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManager
*/
protected $objectManager;
/**
* Class constructor.
*
......@@ -160,9 +167,9 @@ class ExtensionListUtility implements \SplObserver
/**
* Method collects and stores extension version details into the database.
*
* @param \SplSubject|\TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser &$subject a subject notifying this observer
* @param AbstractExtensionXmlParser $subject a subject notifying this observer
*/
protected function loadIntoDatabase(\SplSubject &$subject)
protected function loadIntoDatabase(AbstractExtensionXmlParser &$subject)
{
// flush every 50 rows to database
if ($this->sumRecords !== 0 && $this->sumRecords % 50 === 0) {
......@@ -175,7 +182,7 @@ class ExtensionListUtility implements \SplObserver
);
$this->arrRows = [];
}
$versionRepresentations = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionStringToArray($subject->getVersion());
$versionRepresentations = VersionNumberUtility::convertVersionStringToArray($subject->getVersion());
// order must match that of self::$fieldNames!
$this->arrRows[] = [
$subject->getExtkey(),
......@@ -210,7 +217,7 @@ class ExtensionListUtility implements \SplObserver
*/
public function update(\SplSubject $subject)
{
if (is_subclass_of($subject, \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser::class)) {
if (is_subclass_of($subject, AbstractExtensionXmlParser::class)) {
$this->loadIntoDatabase($subject);
}
}
......
......@@ -4220,7 +4220,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
*
* @param string $index Local_lang key for which to return label (language is determined by $this->lang)
* @param array $LOCAL_LANG The locallang array in which to search
* @return string Label value of $index key.
* @return string|false Label value of $index key.
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10, use LanguageService->getLLL() directly
*/
public function getLLL($index, $LOCAL_LANG)
......
......@@ -38,7 +38,7 @@ class ValidatorTaskAdditionalFieldProvider implements AdditionalFieldProviderInt
* Render additional information fields within the scheduler backend.
*
* @param array $taskInfo Array information of task to return
* @param AbstractTask|null $task The task object being edited. Null when adding a task!
* @param ValidatorTask|null $task The task object being edited. Null when adding a task!
* @param SchedulerModuleController $schedulerModule Reference to the BE module of the Scheduler
* @return array Additional fields
* @see AdditionalFieldProviderInterface->getAdditionalFields($taskInfo, $task, $schedulerModule)
......
<?php
declare(strict_types=1);
declare(strict_types = 1);
namespace TYPO3\CMS\Rsaauth\Report;
......
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