Commit 4fe5a309 authored by Wouter Wolters's avatar Wouter Wolters Committed by Christian Kuhn
Browse files

[TASK] Remove unused local variables

Resolves: #77819
Releases: master
Change-Id: If39540863a1114ce5ce3e57289da54bdfdffc4f2
Reviewed-on: https://review.typo3.org/49764

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Jan Helke's avatarJan Helke <typo3@helke.de>
Tested-by: Jan Helke's avatarJan Helke <typo3@helke.de>
Reviewed-by: Łukasz Uznański's avatarŁukasz Uznański <l.uznanski@macopedia.pl>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 2376d9cb
......@@ -112,7 +112,6 @@ abstract class AbstractContainer extends AbstractNode
// Making the array of file items:
$itemArray = GeneralUtility::trimExplode(',', $value, true);
// Showing thumbnails:
$thumbnail = '';
$imgs = [];
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
foreach ($itemArray as $imgRead) {
......
......@@ -35,7 +35,6 @@ class FullRecordContainer extends AbstractContainer
public function render()
{
$table = $this->data['tableName'];
$row = $this->data['databaseRow'];
$recordTypeValue = $this->data['recordTypeValue'];
// Load the description content for the table if requested
......
......@@ -480,7 +480,6 @@ class SingleFieldContainer extends AbstractContainer
protected function inlineFieldShouldBeSkipped()
{
$table = $this->data['tableName'];
$row = $this->data['databaseRow'];
$fieldName = $this->data['fieldName'];
$fieldConfig = $this->data['processedTca']['columns'][$fieldName]['config'];
......
......@@ -39,11 +39,6 @@ class SelectMultipleSideBySideElement extends AbstractFormElement
// Field configuration from TCA:
$config = $parameterArray['fieldConf']['config'];
// Creating the label for the "No Matching Value" entry.
$noMatchingLabel = isset($parameterArray['fieldTSConfig']['noMatchingValue_label'])
? $this->getLanguageService()->sL(trim($parameterArray['fieldTSConfig']['noMatchingValue_label']))
: '[ ' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.noMatchingValue') . ' ]';
$selItems = $config['items'];
$html = '';
$disabled = '';
......
......@@ -40,8 +40,6 @@ class TextElement extends AbstractFormElement
*/
public function render()
{
$languageService = $this->getLanguageService();
$table = $this->data['tableName'];
$fieldName = $this->data['fieldName'];
$row = $this->data['databaseRow'];
......
......@@ -709,7 +709,6 @@ abstract class AbstractItemProvider
}
// Get all sheets and title
foreach ($flexForms as $extIdent => $extConf) {
$extTitle = $languageService->sL(trim($extConf['title']));
// Get all fields in sheet
foreach ($extConf['ds']['sheets'] as $sheetName => $sheet) {
if (empty($sheet['ROOT']['el']) || !is_array($sheet['ROOT']['el'])) {
......
......@@ -609,8 +609,6 @@ class FolderTreeView extends AbstractTreeView
{
if (!$this->storageHashNumbers) {
$this->storageHashNumbers = [];
// Mapping md5-hash to shorter number:
$hashMap = [];
foreach ($this->storages as $storageUid => $storage) {
$fileMounts = $storage->getFileMounts();
if (!empty($fileMounts)) {
......
......@@ -2830,7 +2830,6 @@ class BackendUtility
// Initialize some variables
$helpText = '';
$abbrClassAdd = '';
$wrappedText = $text;
$hasHelpTextOverload = !empty($overloadHelpText);
// Get the help text that should be shown on hover
if (!$hasHelpTextOverload) {
......
......@@ -863,7 +863,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
if ($lP) {
list($lpRecord) = BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $id, 'AND sys_language_uid=' . $lP);
BackendUtility::workspaceOL('pages_language_overlay', $lpRecord);
$params = '&edit[pages_language_overlay][' . $lpRecord['uid'] . ']=edit&overrideVals[pages_language_overlay][sys_language_uid]=' . $lP;
$recordIcon = BackendUtility::wrapClickMenuOnIcon(
$this->iconFactory->getIconForRecord('pages_language_overlay', $lpRecord, Icon::SIZE_SMALL)->render(),
'pages_language_overlay',
......
......@@ -2413,7 +2413,6 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
$path = '';
$pageCount = count($rl);
if (is_array($rl) && !empty($rl)) {
$index = 0;
$breadcrumbWrap = isset($this->conf['breadcrumbWrap']) ? $this->conf['breadcrumbWrap'] : '/';
$breadcrumbWraps = $GLOBALS['TSFE']->tmpl->splitConfArray(['wrap' => $breadcrumbWrap], $pageCount);
foreach ($rl as $k => $v) {
......
......@@ -509,7 +509,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getPagePermsClause'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getPagePermsClause'] as $_funcRef) {
$_params = ['currentClause' => $constraint, 'perms' => $perms];
$str = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
GeneralUtility::callUserFunction($_funcRef, $_params, $this);
}
}
return $constraint;
......
......@@ -830,7 +830,6 @@ class RelationHandler
->where($queryBuilder->expr()->eq($uidLocal_field, (int)$uid));
// Boolean: does the field "tablename" need to be filled?
$prep = $tableC > 1 || $prependTableName || $this->MM_isMultiTableRelationship;
$additionalWhere_tablenames = '';
if ($this->MM_is_foreign && $prep) {
$queryBuilder->andWhere(
$queryBuilder->expr()->eq('tablenames', $queryBuilder->createNamedParameter($this->currentTable))
......
......@@ -283,7 +283,6 @@ class SoftReferenceIndex
*/
public function findRef_email($content, $spParams)
{
$resultArray = [];
// Email:
$parts = preg_split('/([^[:alnum:]]+)([A-Za-z0-9\\._-]+[@][A-Za-z0-9\\._-]+[\\.].[A-Za-z0-9]+)/', ' ' . $content . ' ', 10000, PREG_SPLIT_DELIM_CAPTURE);
foreach ($parts as $idx => $value) {
......@@ -320,7 +319,6 @@ class SoftReferenceIndex
*/
public function findRef_url($content, $spParams)
{
$resultArray = [];
// URLs
$parts = preg_split('/([^[:alnum:]"\']+)((http|ftp):\\/\\/[^[:space:]"\'<>]*)([[:space:]])/', ' ' . $content . ' ', 10000, PREG_SPLIT_DELIM_CAPTURE);
foreach ($parts as $idx => $value) {
......@@ -360,12 +358,11 @@ class SoftReferenceIndex
*/
public function findRef_extension_fileref($content, $spParams)
{
$resultArray = [];
// Files starting with EXT:
$parts = preg_split('/([^[:alnum:]"\']+)(EXT:[[:alnum:]_]+\\/[^[:space:]"\',]*)/', ' ' . $content . ' ', 10000, PREG_SPLIT_DELIM_CAPTURE);
foreach ($parts as $idx => $value) {
if ($idx % 3 == 2) {
$tokenID = $this->makeTokenID($idx);
$this->makeTokenID($idx);
$elements[$idx] = [];
$elements[$idx]['matchString'] = $value;
}
......
......@@ -31,7 +31,7 @@ class AbstractFrontendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
->disableOriginalConstructor()
->getMock();
foreach (['x', 'someValue', '123fivesixseveneight', 'some&', 'ab_cd%', rawurlencode('resource://some/äöü$&% sadf'), str_repeat('x', 250)] as $identifier) {
$abstractCache = $this->getMockBuilder(\TYPO3\CMS\Core\Cache\Frontend\StringFrontend::class)
$this->getMockBuilder(\TYPO3\CMS\Core\Cache\Frontend\StringFrontend::class)
->setMethods(['__construct', 'get', 'set', 'has', 'remove', 'getByTag', 'flush', 'flushByTag', 'collectGarbage'])
->setConstructorArgs([$identifier, $mockBackend])
->getMock();
......@@ -49,7 +49,7 @@ class AbstractFrontendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
->getMock();
foreach (['', 'abc def', 'foo!', 'bar:', 'some/', 'bla*', 'one+', 'äöü', str_repeat('x', 251), 'x$', '\\a', 'b#'] as $identifier) {
try {
$abstractCache = $this->getMockBuilder(\TYPO3\CMS\Core\Cache\Frontend\StringFrontend::class)
$this->getMockBuilder(\TYPO3\CMS\Core\Cache\Frontend\StringFrontend::class)
->setMethods(['__construct', 'get', 'set', 'has', 'remove', 'getByTag', 'flush', 'flushByTag', 'collectGarbage'])
->setConstructorArgs([$identifier, $mockBackend])
->getMock();
......
......@@ -60,7 +60,7 @@ class FileStreamWrapperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
public function windowsPathsCanBeProcessed()
{
$cRoot = 'C:\\Windows\\Root\\Path\\';
$root = vfsStream::setup('root');
vfsStream::setup('root');
FileStreamWrapper::init($cRoot);
FileStreamWrapper::registerOverlayPath('fileadmin', 'vfs://root/fileadmin');
......
......@@ -205,7 +205,7 @@ class MessageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717266);
$message = $this->message->withHeader('X-Foo', [$value]);
$this->message->withHeader('X-Foo', [$value]);
}
/**
......@@ -230,7 +230,7 @@ class MessageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717266);
$message = $this->message->withHeader('X-Foo', $value);
$this->message->withHeader('X-Foo', $value);
}
/**
......@@ -240,7 +240,7 @@ class MessageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717267);
$message = $this->message->withAddedHeader('X-Foo', $value);
$this->message->withAddedHeader('X-Foo', $value);
}
/**
......
......@@ -335,8 +335,8 @@ class RequestTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
public function getRequestTargetIsResetWithNewUri()
{
$request = (new Request())->withUri(new Uri('https://example.com/foo/bar'));
$original = $request->getRequestTarget();
$newRequest = $request->withUri(new Uri('http://mwop.net/bar/baz'));
$request->getRequestTarget();
$request->withUri(new Uri('http://mwop.net/bar/baz'));
}
/**
......@@ -523,6 +523,6 @@ class RequestTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
public function constructorRaisesExceptionForHeadersWithCRLFVectors($name, $value)
{
$this->expectException(\InvalidArgumentException::class);
$request = new Request(null, null, 'php://memory', [$name => $value]);
new Request(null, null, 'php://memory', [$name => $value]);
}
}
......@@ -75,7 +75,7 @@ class ResponseTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
public function testCannotSetInvalidStatusCode($code)
{
$this->expectException(\InvalidArgumentException::class);
$response = $this->response->withStatus($code);
$this->response->withStatus($code);
}
/**
......@@ -227,6 +227,6 @@ class ResponseTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
public function cnstructorRaisesExceptionForHeadersWithCRLFVectors($name, $value)
{
$this->expectException(\InvalidArgumentException::class);
$request = new Response('php://memory', 200, [$name => $value]);
new Response('php://memory', 200, [$name => $value]);
}
}
......@@ -98,7 +98,7 @@ class StreamTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
public function constructorRaisesExceptionWhenPassingInvalidStreamResource()
{
$this->expectException(\InvalidArgumentException::class);
$stream = new Stream([' THIS WILL NOT WORK ']);
new Stream([' THIS WILL NOT WORK ']);
}
/**
......
......@@ -186,7 +186,7 @@ class UriTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
$uri = new Uri('https://user:pass@local.example.com:3001/foo?bar=baz#quz');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717326);
$new = $uri->withPort($port);
$uri->withPort($port);
}
/**
......@@ -224,7 +224,7 @@ class UriTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
$uri = new Uri('https://user:pass@local.example.com:3001/foo?bar=baz#quz');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717328);
$new = $uri->withPath($path);
$uri->withPath($path);
}
/**
......@@ -235,7 +235,7 @@ class UriTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
$uri = new Uri('https://user:pass@local.example.com:3001/foo?bar=baz#quz');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717330);
$new = $uri->withPath('/bar/baz?bat=quz');
$uri->withPath('/bar/baz?bat=quz');
}
/**
......@@ -246,7 +246,7 @@ class UriTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
$uri = new Uri('https://user:pass@local.example.com:3001/foo?bar=baz#quz');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717332);
$new = $uri->withPath('/bar/baz#bat');
$uri->withPath('/bar/baz#bat');
}
/**
......@@ -284,7 +284,7 @@ class UriTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
$uri = new Uri('https://user:pass@local.example.com:3001/foo?bar=baz#quz');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717334);
$new = $uri->withQuery($query);
$uri->withQuery($query);
}
/**
......@@ -295,7 +295,7 @@ class UriTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
$uri = new Uri('https://user:pass@local.example.com:3001/foo?bar=baz#quz');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717336);
$new = $uri->withQuery('baz=bat#quz');
$uri->withQuery('baz=bat#quz');
}
/**
......@@ -446,7 +446,7 @@ class UriTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionCode(1436717338);
$uri = new Uri($scheme . '://example.com');
new Uri($scheme . '://example.com');
}
/**
......
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