Commit 17376c0a authored by Stefan Neufeind's avatar Stefan Neufeind
Browse files

[TASK] Remove unneeded parenthesis on array-access

Change-Id: I450ef2985bf1086fb8cc247406a94cce8971f061
Resolves: #71714
Releases: master
Reviewed-on: https://review.typo3.org/44812


Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
parent 205351fc
......@@ -873,7 +873,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface
$splitModuleName = explode('_', $moduleName);
$title = $languageService->moduleLabels['tabs'][$splitModuleName[0] . '_tab'];
if (count($splitModuleName) > 1) {
$title .= '>' . $languageService->moduleLabels['tabs'][($moduleName . '_tab')];
$title .= '>' . $languageService->moduleLabels['tabs'][$moduleName . '_tab'];
}
}
if ($parentModuleName) {
......
......@@ -328,7 +328,7 @@ class ColorpickerController extends AbstractWizardController
while (isset($color[$columns * $rows])) {
$tCells = array();
for ($i = 0; $i < $columns; $i++) {
$tCells[] = '<td bgcolor="' . $color[($columns * $rows + $i)] . '" class="t3js-colorpicker-value" data-color-value="' . htmlspecialchars($color[($columns * $rows + $i)]) . '" title="' . htmlspecialchars($color[($columns * $rows + $i)]) . '">&nbsp;&nbsp;</td>';
$tCells[] = '<td bgcolor="' . $color[$columns * $rows + $i] . '" class="t3js-colorpicker-value" data-color-value="' . htmlspecialchars($color[($columns * $rows + $i)]) . '" title="' . htmlspecialchars($color[($columns * $rows + $i)]) . '">&nbsp;&nbsp;</td>';
}
$tRows[] = '<tr>' . implode('', $tCells) . '</tr>';
$rows++;
......
......@@ -529,7 +529,7 @@ class TableController extends AbstractWizardController
// will be TRUE after one row is added while if rows are added in the bottom
// of the table there will be no existing rows to stop the addition of new rows
// which means it will add up to $this->numNewRows rows then.
if (!isset($this->TABLECFG['c'][($kk + $a)])) {
if (!isset($this->TABLECFG['c'][$kk + $a])) {
$this->TABLECFG['c'][$kk + $a] = array();
} else {
break;
......
......@@ -324,7 +324,7 @@ abstract class AbstractItemProvider
// Add label for main module:
$pp = explode('_', $theMod);
if (count($pp) > 1) {
$label .= $languageService->moduleLabels['tabs'][($pp[0] . '_tab')] . '>';
$label .= $languageService->moduleLabels['tabs'][$pp[0] . '_tab'] . '>';
}
// Add modules own label now:
$label .= $languageService->moduleLabels['tabs'][$theMod . '_tab'];
......
......@@ -3663,7 +3663,7 @@ class BackendUtility
$userName,
self::calcAge($GLOBALS['EXEC_TIME'] - $row['tstamp'], $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears'))
);
if ($row['record_pid'] && !isset($GLOBALS['LOCKED_RECORDS'][($row['record_table'] . ':' . $row['record_pid'])])) {
if ($row['record_pid'] && !isset($GLOBALS['LOCKED_RECORDS'][$row['record_table'] . ':' . $row['record_pid']])) {
$GLOBALS['LOCKED_RECORDS']['pages:' . $row['record_pid']]['msg'] = sprintf(
$lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.lockedRecordUser_content'),
$userType,
......
......@@ -653,7 +653,7 @@ abstract class AbstractUserAuthentication
GeneralUtility::devLog('User found: ' . GeneralUtility::arrayToLogString($row, array($this->userid_column, $this->username_column)), \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::class, 0);
}
// User found, just stop to search for more if not configured to go on
if (!$this->svConfig['setup'][($this->loginType . '_fetchAllUsers')]) {
if (!$this->svConfig['setup'][$this->loginType . '_fetchAllUsers']) {
break;
}
}
......
......@@ -1284,7 +1284,7 @@ class CharsetConverter
foreach (array_reverse($decomposition['U+' . $code_value]) as $cv) {
array_unshift($to, $cv);
}
} elseif (!isset($mark[('U+' . $code_value)])) {
} elseif (!isset($mark['U+' . $code_value])) {
// remove mark
array_push($code_decomp, $code_value);
}
......
......@@ -155,7 +155,7 @@ class CommandLineController
foreach ($argSplit as $i => $v) {
$ii = $i;
if ($i > 0) {
if (!isset($cli_args_copy[$argSplit[0]][($i - 1)]) && $v[0] != '[') {
if (!isset($cli_args_copy[$argSplit[0]][$i - 1]) && $v[0] != '[') {
// Using "[]" around a parameter makes it optional
echo 'ERROR: Option "' . $argSplit[0] . '" requires a value ("' . $v . '") on position ' . $i . LF;
die;
......
......@@ -1558,7 +1558,7 @@ class DataHandler
}
// Look for transformation flag:
if ((string)$incomingFieldArray[('_TRANSFORM_' . $vconf['field'])] === 'RTE') {
if ((string)$incomingFieldArray['_TRANSFORM_' . $vconf['field']] === 'RTE') {
if ($theTypeString === null) {
$theTypeString = BackendUtility::getTCAtypeValue($table, $currentRecord);
}
......@@ -3131,7 +3131,7 @@ class DataHandler
// @deprecated: flexFormXMLincludeDiffBase is only enabled by ext:compatibility6 since TYPO3 CMS 7, vDEFbase can be unset / ignored with TYPO3 CMS 8
if ($this->clear_flexFormData_vDEFbase) {
$dataValues[$key][$vKey . '.vDEFbase'] = '';
} elseif ($this->updateModeL10NdiffData && $GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase'] && $vKey !== 'vDEF' && ((string)$dataValues[$key][$vKey] !== (string)$dataValues_current[$key][$vKey] || !isset($dataValues_current[$key][($vKey . '.vDEFbase')]) || $this->updateModeL10NdiffData === 'FORCE_FFUPD')) {
} elseif ($this->updateModeL10NdiffData && $GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase'] && $vKey !== 'vDEF' && ((string)$dataValues[$key][$vKey] !== (string)$dataValues_current[$key][$vKey] || !isset($dataValues_current[$key][$vKey . '.vDEFbase']) || $this->updateModeL10NdiffData === 'FORCE_FFUPD')) {
// Now, check if a vDEF value is submitted in the input data, if so we expect this has been processed prior to this operation (normally the case since those fields are higher in the form) and we can use that:
if (isset($dataValues[$key]['vDEF'])) {
$diffValue = $dataValues[$key]['vDEF'];
......@@ -6043,7 +6043,7 @@ class DataHandler
*/
public function isRecordInWebMount($table, $id)
{
if (!isset($this->isRecordInWebMount_Cache[($table . ':' . $id)])) {
if (!isset($this->isRecordInWebMount_Cache[$table . ':' . $id])) {
$recP = $this->getRecordProperties($table, $id);
$this->isRecordInWebMount_Cache[$table . ':' . $id] = $this->isInWebMount($recP['event_pid']);
}
......@@ -7038,12 +7038,12 @@ class DataHandler
if (!$fieldConfiguration['MM'] && $this->isSubmittedValueEqualToStoredValue($val, $currentRecord[$col], $cRecTypes[$col], $isNullField)) {
unset($fieldArray[$col]);
} else {
if (!isset($this->mmHistoryRecords[($table . ':' . $id)]['oldRecord'][$col])) {
if (!isset($this->mmHistoryRecords[$table . ':' . $id]['oldRecord'][$col])) {
$this->historyRecords[$table . ':' . $id]['oldRecord'][$col] = $currentRecord[$col];
} elseif ($this->mmHistoryRecords[$table . ':' . $id]['oldRecord'][$col] != $this->mmHistoryRecords[$table . ':' . $id]['newRecord'][$col]) {
$this->historyRecords[$table . ':' . $id]['oldRecord'][$col] = $this->mmHistoryRecords[$table . ':' . $id]['oldRecord'][$col];
}
if (!isset($this->mmHistoryRecords[($table . ':' . $id)]['newRecord'][$col])) {
if (!isset($this->mmHistoryRecords[$table . ':' . $id]['newRecord'][$col])) {
$this->historyRecords[$table . ':' . $id]['newRecord'][$col] = $fieldArray[$col];
} elseif ($this->mmHistoryRecords[$table . ':' . $id]['newRecord'][$col] != $this->mmHistoryRecords[$table . ':' . $id]['oldRecord'][$col]) {
$this->historyRecords[$table . ':' . $id]['newRecord'][$col] = $this->mmHistoryRecords[$table . ':' . $id]['newRecord'][$col];
......
......@@ -1186,7 +1186,7 @@ class QueryGenerator
$out[] = '<select class="form-control t3js-submit-change" name="' . $name . '">';
for ($i = 32 * $compOffSet + $neg; $i < 32 * ($compOffSet + 1); $i += 2) {
if ($this->lang['comparison'][$i . '_']) {
$out[] = '<option value="' . $i . '"' . ($i >> 1 === $comparison >> 1 ? ' selected' : '') . '>' . htmlspecialchars($this->lang['comparison'][($i . '_')]) . '</option>';
$out[] = '<option value="' . $i . '"' . ($i >> 1 === $comparison >> 1 ? ' selected' : '') . '>' . htmlspecialchars($this->lang['comparison'][$i . '_']) . '</option>';
}
}
$out[] = '</select>';
......
......@@ -865,7 +865,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser
$cc = 0;
$aC = count($blockSplit);
// Avoid superfluous linebreaks by transform_db after ending headListTag
while ($aC && trim($blockSplit[($aC - 1)]) === '') {
while ($aC && trim($blockSplit[$aC - 1]) === '') {
unset($blockSplit[$aC - 1]);
$aC = count($blockSplit);
}
......
......@@ -1293,7 +1293,7 @@ class GraphicalFunctions
$wordsArray = preg_split('#([- .,!:]+)#', $string, -1, PREG_SPLIT_DELIM_CAPTURE);
$wordsCount = count($wordsArray);
for ($index = 0; $index < $wordsCount; $index += 2) {
$wordPairs[] = $wordsArray[$index] . $wordsArray[($index + 1)];
$wordPairs[] = $wordsArray[$index] . $wordsArray[$index + 1];
}
return $wordPairs;
}
......
......@@ -302,7 +302,7 @@ class Rfc822AddressesParser
for ($i = 0; $i < $partsCounter; $i++) {
if ($this->_hasUnclosedQuotes($string) || $this->_hasUnclosedBrackets($string, '<>') || $this->_hasUnclosedBrackets($string, '[]') || $this->_hasUnclosedBrackets($string, '()') || substr($string, -1) == '\\') {
if (isset($parts[$i + 1])) {
$string = $string . $char . $parts[($i + 1)];
$string = $string . $char . $parts[$i + 1];
} else {
$this->error = 'Invalid address spec. Unclosed bracket or quotes';
return false;
......@@ -385,7 +385,7 @@ class Rfc822AddressesParser
$num--;
}
if (isset($parts[$i + 1])) {
$parts[$i + 1] = $parts[$i] . $char . $parts[($i + 1)];
$parts[$i + 1] = $parts[$i] . $char . $parts[$i + 1];
}
}
return $num;
......
......@@ -473,7 +473,7 @@ class ExtendedTemplateService extends TemplateService
}
$aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
if ($this->bType != 'const') {
$ln = is_array($arr[$key . '.ln..']) ? 'Defined in: ' . $this->lineNumberToScript($arr[($key . '.ln..')]) : 'N/A';
$ln = is_array($arr[$key . '.ln..']) ? 'Defined in: ' . $this->lineNumberToScript($arr[$key . '.ln..']) : 'N/A';
} else {
$ln = '';
}
......
......@@ -242,7 +242,7 @@ class TypoScriptParser
$pre = '[GLOBAL]';
while ($pre) {
if ($this->breakPointLN && $pre === '[_BREAK]') {
$this->error('Breakpoint at ' . ($this->lineNumberOffset + $this->rawP - 2) . ': Line content was "' . $this->raw[($this->rawP - 2)] . '"', 1);
$this->error('Breakpoint at ' . ($this->lineNumberOffset + $this->rawP - 2) . ': Line content was "' . $this->raw[$this->rawP - 2] . '"', 1);
break;
}
$preUppercase = strtoupper($pre);
......@@ -437,7 +437,7 @@ class TypoScriptParser
return $exitSig;
}
} else {
if (!isset($setup[($objStrName . '.')])) {
if (!isset($setup[$objStrName . '.'])) {
$setup[$objStrName . '.'] = array();
}
$exitSig = $this->parseSub($setup[$objStrName . '.']);
......
......@@ -231,9 +231,9 @@ class ExtendedFileUtility extends BasicFileUtility
if ($this->fileCmdMap['upload']) {
$uploads = $this->fileCmdMap['upload'];
foreach ($uploads as $upload) {
if (empty($_FILES[('upload_' . $upload['data'])]['name'])
|| (is_array($_FILES[('upload_' . $upload['data'])]['name'])
&& empty($_FILES[('upload_' . $upload['data'])]['name'][0])
if (empty($_FILES['upload_' . $upload['data']]['name'])
|| (is_array($_FILES['upload_' . $upload['data']]['name'])
&& empty($_FILES['upload_' . $upload['data']]['name'][0])
)
) {
unset($this->fileCmdMap['upload'][$upload['data']]);
......
......@@ -1206,23 +1206,23 @@ class GeneralUtility
static $bytes = '';
$bytesToGenerate = max(4096, $bytesToReturn);
// if we have not enough random bytes cached, we generate new ones
if (!isset($bytes[($bytesToReturn - 1)])) {
if (!isset($bytes[$bytesToReturn - 1])) {
if (TYPO3_OS === 'WIN') {
// Openssl seems to be deadly slow on Windows, so try to use mcrypt
$bytes .= self::generateRandomBytesMcrypt($bytesToGenerate);
} else {
// Try to use native PHP functions first, precedence has openssl
$bytes .= self::generateRandomBytesOpenSsl($bytesToGenerate);
if (!isset($bytes[($bytesToReturn - 1)])) {
if (!isset($bytes[$bytesToReturn - 1])) {
$bytes .= self::generateRandomBytesMcrypt($bytesToGenerate);
}
// If openssl and mcrypt failed, try /dev/urandom
if (!isset($bytes[($bytesToReturn - 1)])) {
if (!isset($bytes[$bytesToReturn - 1])) {
$bytes .= self::generateRandomBytesUrandom($bytesToGenerate);
}
}
// Fall back if other random byte generation failed until now
if (!isset($bytes[($bytesToReturn - 1)])) {
if (!isset($bytes[$bytesToReturn - 1])) {
$bytes .= self::generateRandomBytesFallback($bytesToReturn);
}
}
......@@ -1292,7 +1292,7 @@ class GeneralUtility
$bytes = '';
// We initialize with somewhat random.
$randomState = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . base_convert(memory_get_usage() % pow(10, 6), 10, 2) . microtime() . StringUtility::getUniqueId() . getmypid();
while (!isset($bytes[($bytesToReturn - 1)])) {
while (!isset($bytes[$bytesToReturn - 1])) {
$randomState = sha1(microtime() . mt_rand() . $randomState);
$bytes .= sha1(mt_rand() . $randomState, true);
}
......@@ -2102,15 +2102,15 @@ class GeneralUtility
// Use tag based on grand-parent + parent tag name
if (isset($options['grandParentTagMap'][$stackData['grandParentTagName'] . '/' . $stackData['parentTagName']])) {
$attr .= ' index="' . htmlspecialchars($tagName) . '"';
$tagName = (string)$options['grandParentTagMap'][($stackData['grandParentTagName'] . '/' . $stackData['parentTagName'])];
$tagName = (string)$options['grandParentTagMap'][$stackData['grandParentTagName'] . '/' . $stackData['parentTagName']];
} elseif (isset($options['parentTagMap'][$stackData['parentTagName'] . ':_IS_NUM']) && MathUtility::canBeInterpretedAsInteger($tagName)) {
// Use tag based on parent tag name + if current tag is numeric
$attr .= ' index="' . htmlspecialchars($tagName) . '"';
$tagName = (string)$options['parentTagMap'][($stackData['parentTagName'] . ':_IS_NUM')];
$tagName = (string)$options['parentTagMap'][$stackData['parentTagName'] . ':_IS_NUM'];
} elseif (isset($options['parentTagMap'][$stackData['parentTagName'] . ':' . $tagName])) {
// Use tag based on parent tag name + current tag
$attr .= ' index="' . htmlspecialchars($tagName) . '"';
$tagName = (string)$options['parentTagMap'][($stackData['parentTagName'] . ':' . $tagName)];
$tagName = (string)$options['parentTagMap'][$stackData['parentTagName'] . ':' . $tagName];
} elseif (isset($options['parentTagMap'][$stackData['parentTagName']])) {
// Use tag based on parent tag name:
$attr .= ' index="' . htmlspecialchars($tagName) . '"';
......
......@@ -189,7 +189,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
}
if ($useTfoot) {
$tableContents .= '
<tfoot>' . $rows[($rCount - 1)] . '</tfoot>';
<tfoot>' . $rows[$rCount - 1] . '</tfoot>';
unset($rows[$rCount - 1]);
$addTbody = 1;
}
......@@ -861,7 +861,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
$imageMarkers['caption'] = $this->cObj->substituteMarkerArray($imageMarkers['caption'], $captionMarkers, '###|###', 1, 1);
}
if ($addClassesImageConf[$imagesCounter - 1]['addClassesImage']) {
$imageMarkers['classes'] = ' ' . $addClassesImageConf[($imagesCounter - 1)]['addClassesImage'];
$imageMarkers['classes'] = ' ' . $addClassesImageConf[$imagesCounter - 1]['addClassesImage'];
}
}
$columnImages[] = $this->cObj->substituteMarkerArray($single, $imageMarkers, '###|###', 1, 1);
......@@ -871,7 +871,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
// Start filling the markers for columnStdWrap
$columnMarkers = array();
if ($addClassesColConf[$columnCounter - 1]['addClassesCol']) {
$columnMarkers['classes'] = ' ' . $addClassesColConf[($columnCounter - 1)]['addClassesCol'];
$columnMarkers['classes'] = ' ' . $addClassesColConf[$columnCounter - 1]['addClassesCol'];
}
$rowColumns[] = $this->cObj->substituteMarkerArray($rowColumn, $columnMarkers, '###|###', 1, 1);
}
......
......@@ -301,7 +301,7 @@ abstract class AbstractFormFieldViewHelper extends AbstractFormViewHelper
// If count == 2 -> we need to go through the for-loop exactly once
for ($i = 1; $i < count($propertySegments); $i++) {
$object = ObjectAccess::getPropertyPath($formObject, implode('.', array_slice($propertySegments, 0, $i)));
$objectName .= '[' . $propertySegments[($i - 1)] . ']';
$objectName .= '[' . $propertySegments[$i - 1] . ']';
$hiddenIdentityField = $this->renderHiddenIdentityField($object, $objectName);
// Add the hidden identity field to the ViewHelperVariableContainer
$additionalIdentityProperties = $this->viewHelperVariableContainer->get(
......
......@@ -88,7 +88,7 @@ class ContentContentObject extends AbstractContentObject
$_procObj->modifyDBRow($row, $conf['table']);
}
}
if (!$frontendController->recordRegister[($conf['table'] . ':' . $row['uid'])]) {
if (!$frontendController->recordRegister[$conf['table'] . ':' . $row['uid']]) {
$this->cObj->currentRecordNumber++;
$cObj->parentRecordNumber = $this->cObj->currentRecordNumber;
$frontendController->currentRecord = $conf['table'] . ':' . $row['uid'];
......
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