Commit 3252a22c authored by Wouter Wolters's avatar Wouter Wolters Committed by Markus Klein
Browse files

[CLEANUP] Use correct casting syntax

Resolves: #62664
Releases: master
Change-Id: Ib8e0695fc234ab67a2f73a65737e07cf9a2d19c6
Reviewed-on: http://review.typo3.org/33757


Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
parent fdcabab3
......@@ -246,7 +246,7 @@ class BaseScriptClass {
$mergeArray = $GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey];
if (is_array($mergeArray)) {
foreach ($mergeArray as $k => $v) {
if (((string) $v['ws'] === '' || $GLOBALS['BE_USER']->workspace === 0 && GeneralUtility::inList($v['ws'], 'online')) || $GLOBALS['BE_USER']->workspace === -1 && GeneralUtility::inList($v['ws'], 'offline') || $GLOBALS['BE_USER']->workspace > 0 && GeneralUtility::inList($v['ws'], 'custom')) {
if (((string)$v['ws'] === '' || $GLOBALS['BE_USER']->workspace === 0 && GeneralUtility::inList($v['ws'], 'online')) || $GLOBALS['BE_USER']->workspace === -1 && GeneralUtility::inList($v['ws'], 'offline') || $GLOBALS['BE_USER']->workspace > 0 && GeneralUtility::inList($v['ws'], 'custom')) {
$menuArr[$k] = $GLOBALS['LANG']->sL($v['title']);
}
}
......
......@@ -249,7 +249,7 @@ class ModuleSettings {
}
$storageArr = array(
'title' => $data['title'],
'desc' => (string) $data['desc'],
'desc' => (string)$data['desc'],
'data' => $storageData,
'user' => NULL,
'tstamp' => $GLOBALS['EXEC_TIME']
......
......@@ -185,7 +185,7 @@ abstract class AbstractRecordList {
* @param string $icon Is the <img>+<a> of the record. If not supplied the first 'join'-icon will be a 'line' instead
* @param array $data Is the dataarray, record with the fields. Notice: These fields are (currently) NOT htmlspecialchar'ed before being wrapped in <td>-tags
* @param string $tdParams Is insert in the <td>-tags. Must carry a ' ' as first character
* @param int OBSOLETE - NOT USED ANYMORE. $lMargin is the leftMargin (integer)
* @param int OBSOLETE - NOT USED ANYMORE. $lMargin is the leftMargin (int)
* @param string $altLine Is the HTML <img>-tag for an alternative 'gfx/ol/line.gif'-icon (used in the top)
* @return string HTML content for the table row
*/
......
......@@ -71,7 +71,7 @@ abstract class AbstractSpriteHandler implements \TYPO3\CMS\Backend\Sprite\Sprite
// Saves which CSS Files are currently "allowed to be in place"
$allowedCssFilesinTempDir = array(basename($this->cssTcaFile));
// Process every registeres file
foreach ((array) $GLOBALS['TBE_STYLES']['spritemanager']['cssFiles'] as $file) {
foreach ((array)$GLOBALS['TBE_STYLES']['spritemanager']['cssFiles'] as $file) {
$fileName = basename($file);
// File should be present
$allowedCssFilesinTempDir[] = $fileName;
......
......@@ -64,7 +64,7 @@ class SimpleSpriteHandler extends \TYPO3\CMS\Backend\Sprite\AbstractSpriteHandle
// Backpath from the stylesheet file ($cssTcaFile) to PATH_site dir
// in order to set the background-image URL paths correct
$iconPath = '../../' . TYPO3_mainDir;
$iconsToProcess = array_merge((array) $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons'], $this->collectTcaSpriteIcons());
$iconsToProcess = array_merge((array)$GLOBALS['TBE_STYLES']['spritemanager']['singleIcons'], $this->collectTcaSpriteIcons());
foreach ($iconsToProcess as $iconName => $iconFile) {
$css = str_replace('###NAME###', str_replace(array('extensions-', 'tcarecords-'), array('', ''), $iconName), $this->styleSheetTemplateExtIcons);
$css = str_replace('###IMAGE###', \TYPO3\CMS\Core\Utility\GeneralUtility::resolveBackPath($iconPath . $iconFile), $css);
......
......@@ -41,7 +41,7 @@ class SpriteBuildingHandler extends AbstractSpriteHandler {
->setIncludeTimestampInCSS(TRUE)
->setSpriteFolder(SpriteManager::$tempPath)
->setCSSFolder(SpriteManager::$tempPath);
$iconsToProcess = array_merge((array) $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons'], $this->collectTcaSpriteIcons());
$iconsToProcess = array_merge((array)$GLOBALS['TBE_STYLES']['spritemanager']['singleIcons'], $this->collectTcaSpriteIcons());
foreach ($iconsToProcess as $iconName => $iconFile) {
$iconsToProcess[$iconName] = GeneralUtility::resolveBackPath('typo3/' . $iconFile);
}
......
......@@ -92,7 +92,7 @@ class SpriteManager {
// Generate CSS and TCA files, build icon set register
$handler->generate();
// Get all icons registered from skins, merge with core icon list
$availableSkinIcons = (array) $GLOBALS['TBE_STYLES']['spriteIconApi']['coreSpriteImageNames'];
$availableSkinIcons = (array)$GLOBALS['TBE_STYLES']['spriteIconApi']['coreSpriteImageNames'];
if (isset($GLOBALS['TBE_STYLES']['skins']) && is_array($GLOBALS['TBE_STYLES']['skins'])) {
foreach ($GLOBALS['TBE_STYLES']['skins'] as $skinData) {
$availableSkinIcons = array_merge($availableSkinIcons, (array)$skinData['availableSpriteIcons']);
......@@ -100,7 +100,7 @@ class SpriteManager {
}
// Merge icon names provided by the skin, with
// registered "complete sprites" and the handler class
$iconNames = array_merge($availableSkinIcons, (array) $GLOBALS['TBE_STYLES']['spritemanager']['spriteIconsAvailable'], $handler->getAvailableIconNames());
$iconNames = array_merge($availableSkinIcons, (array)$GLOBALS['TBE_STYLES']['spritemanager']['spriteIconsAvailable'], $handler->getAvailableIconNames());
$GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'] = $iconNames;
$cacheFileContent = '$GLOBALS[\'TBE_STYLES\'][\'spriteIconApi\'][\'iconsAvailable\'] = ';
......@@ -134,7 +134,7 @@ class SpriteManager {
* @return void
*/
static public function addIconSprite(array $icons, $styleSheetFile = '') {
$GLOBALS['TBE_STYLES']['spritemanager']['spriteIconsAvailable'] = array_merge((array) $GLOBALS['TBE_STYLES']['spritemanager']['spriteIconsAvailable'], $icons);
$GLOBALS['TBE_STYLES']['spritemanager']['spriteIconsAvailable'] = array_merge((array)$GLOBALS['TBE_STYLES']['spritemanager']['spriteIconsAvailable'], $icons);
if ($styleSheetFile !== '') {
$GLOBALS['TBE_STYLES']['spritemanager']['cssFiles'][] = $styleSheetFile;
}
......
......@@ -347,7 +347,7 @@ function jumpToUrl(URL) {
// Initializes the page rendering object:
$this->getPageRenderer();
// Setting default scriptID:
if (($temp_M = (string) GeneralUtility::_GET('M')) && $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M]) {
if (($temp_M = (string)GeneralUtility::_GET('M')) && $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M]) {
$this->scriptID = preg_replace('/^.*\\/(sysext|ext)\\//', 'ext/', $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M] . 'index.php');
} else {
$this->scriptID = preg_replace('/^.*\\/(sysext|ext)\\//', 'ext/', \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(PATH_thisScript));
......@@ -622,7 +622,7 @@ function jumpToUrl(URL) {
*/
public function makeShortcutUrl($gvList, $setList) {
$GET = GeneralUtility::_GET();
$storeArray = array_merge(GeneralUtility::compileSelectedGetVarsFromArray($gvList, $GET), array('SET' => GeneralUtility::compileSelectedGetVarsFromArray($setList, (array) $GLOBALS['SOBE']->MOD_SETTINGS)));
$storeArray = array_merge(GeneralUtility::compileSelectedGetVarsFromArray($gvList, $GET), array('SET' => GeneralUtility::compileSelectedGetVarsFromArray($setList, (array)$GLOBALS['SOBE']->MOD_SETTINGS)));
$storeUrl = GeneralUtility::implodeArrayForUrl('', $storeArray);
return $storeUrl;
}
......@@ -725,7 +725,7 @@ function jumpToUrl(URL) {
* @return void
*/
public function useCompatibilityTag($useCompatibilityTag = TRUE) {
$this->useCompatibilityTag = (bool) $useCompatibilityTag;
$this->useCompatibilityTag = (bool)$useCompatibilityTag;
}
/*****************************************
......
......@@ -89,7 +89,7 @@ class ClearCacheToolbarItem implements ToolbarItemHookInterface {
// or if the system runs in development mode
// or if $GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] is set (only for admins)
if ($backendUser->getTSConfigVal('options.clearCache.system') || GeneralUtility::getApplicationContext()->isDevelopment()
|| ((bool) $GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] === TRUE && $backendUser->isAdmin())) {
|| ((bool)$GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] === TRUE && $backendUser->isAdmin())) {
$this->cacheActions[] = array(
'id' => 'system',
'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:flushSystemCachesTitle', TRUE),
......
......@@ -102,7 +102,7 @@ class ShortcutToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookI
* @return bool TRUE if user has access, FALSE if not
*/
public function checkAccess() {
return (bool) $GLOBALS['BE_USER']->getTSConfigVal('options.enableBookmarks');
return (bool)$GLOBALS['BE_USER']->getTSConfigVal('options.enableBookmarks');
}
/**
......
......@@ -469,7 +469,7 @@ class ExtDirectNode extends \TYPO3\CMS\Backend\Tree\TreeNode {
* @return void
*/
public function setRecord($record) {
$this->record = (array) $record;
$this->record = (array)$record;
}
/**
......@@ -488,7 +488,7 @@ class ExtDirectNode extends \TYPO3\CMS\Backend\Tree\TreeNode {
* @return void
*/
public function setContextInfo($contextInfo) {
$this->contextInfo = (array) $contextInfo;
$this->contextInfo = (array)$contextInfo;
}
/**
......@@ -497,7 +497,7 @@ class ExtDirectNode extends \TYPO3\CMS\Backend\Tree\TreeNode {
* @return array
*/
public function getContextInfo() {
return (array) $this->contextInfo;
return (array)$this->contextInfo;
}
/**
......
......@@ -32,7 +32,7 @@ class ExtdirectTreeCommands {
*/
public function visiblyNode($nodeData) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
try {
Commands::visiblyNode($node);
$newNode = Commands::getNode($node->getId());
......@@ -55,7 +55,7 @@ class ExtdirectTreeCommands {
*/
public function disableNode($nodeData) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
try {
Commands::disableNode($node);
$newNode = Commands::getNode($node->getId());
......@@ -78,7 +78,7 @@ class ExtdirectTreeCommands {
*/
public function deleteNode($nodeData) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
try {
Commands::deleteNode($node);
$returnValue = array();
......@@ -107,7 +107,7 @@ class ExtdirectTreeCommands {
*/
public function restoreNode($nodeData, $destination) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
try {
Commands::restoreNode($node, $destination);
$newNode = Commands::getNode($node->getId());
......@@ -134,7 +134,7 @@ class ExtdirectTreeCommands {
return array();
}
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
try {
Commands::updateNodeLabel($node, $updatedLabel);
$shortendedText = GeneralUtility::fixed_lgd_cs($updatedLabel, (int)$GLOBALS['BE_USER']->uc['titleLen']);
......@@ -159,7 +159,7 @@ class ExtdirectTreeCommands {
*/
static public function setTemporaryMountPoint($nodeData) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
$GLOBALS['BE_USER']->uc['pageTree_temporaryMountPoint'] = $node->getId();
$GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc);
return Commands::getMountPointPath();
......@@ -174,7 +174,7 @@ class ExtdirectTreeCommands {
*/
public function moveNodeToFirstChildOfDestination($nodeData, $destination) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
try {
Commands::moveNode($node, $destination);
$newNode = Commands::getNode($node->getId(), FALSE);
......@@ -198,7 +198,7 @@ class ExtdirectTreeCommands {
*/
public function moveNodeAfterDestination($nodeData, $destination) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
try {
Commands::moveNode($node, -$destination);
$newNode = Commands::getNode($node->getId(), FALSE);
......@@ -223,7 +223,7 @@ class ExtdirectTreeCommands {
*/
public function copyNodeToFirstChildOfDestination($nodeData, $destination) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
/** @var $dataProvider \TYPO3\CMS\Backend\Tree\Pagetree\DataProvider */
$dataProvider = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\DataProvider');
try {
......@@ -250,7 +250,7 @@ class ExtdirectTreeCommands {
*/
public function copyNodeAfterDestination($nodeData, $destination) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
/** @var $dataProvider \TYPO3\CMS\Backend\Tree\Pagetree\DataProvider */
$dataProvider = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\DataProvider');
try {
......@@ -276,7 +276,7 @@ class ExtdirectTreeCommands {
*/
public function insertNodeToFirstChildOfDestination($parentNodeData, $pageType) {
/** @var $parentNode \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$parentNode = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $parentNodeData);
$parentNode = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$parentNodeData);
try {
$newPageId = Commands::createNode($parentNode, $parentNode->getId(), $pageType);
$returnValue = Commands::getNode($newPageId)->toArray();
......@@ -299,7 +299,7 @@ class ExtdirectTreeCommands {
*/
public function insertNodeAfterDestination($parentNodeData, $destination, $pageType) {
/** @var $parentNode \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$parentNode = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $parentNodeData);
$parentNode = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$parentNodeData);
try {
$newPageId = Commands::createNode($parentNode, -$destination, $pageType);
$returnValue = Commands::getNode($newPageId)->toArray();
......@@ -320,7 +320,7 @@ class ExtdirectTreeCommands {
*/
static public function getViewLink($nodeData) {
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
$javascriptLink = BackendUtility::viewOnClick($node->getId());
preg_match('/window\\.open\\(\'([^\']+)\'/i', $javascriptLink, $match);
return $match[1];
......@@ -368,7 +368,7 @@ class ExtdirectTreeCommands {
}
}
$userSettings->set('BackendComponents.States.' . $stateId, $state);
return (array) $state->stateHash;
return (array)$state->stateHash;
}
}
......@@ -63,7 +63,7 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractExtJsTre
public function getNextTreeLevel($nodeId, $nodeData) {
$this->initDataProvider();
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
if ($nodeId === 'root') {
$nodeCollection = $this->dataProvider->getTreeMounts();
} else {
......@@ -85,7 +85,7 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractExtJsTre
return array();
}
/** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
$node = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array)$nodeData);
$this->initDataProvider();
if ($nodeId === 'root') {
$nodeCollection = $this->dataProvider->getTreeMounts($searchFilter);
......
......@@ -217,12 +217,12 @@ class BackendUtility {
*/
static public function getSQLselectableList($in_list, $tablename, $default_tablename) {
$list = array();
if ((string) trim($in_list) != '') {
if ((string)trim($in_list) != '') {
$tempItemArray = explode(',', trim($in_list));
foreach ($tempItemArray as $key => $val) {
$val = strrev($val);
$parts = explode('_', $val, 2);
if ((string) trim($parts[0]) != '') {
if ((string)trim($parts[0]) != '') {
$theID = (int)strrev($parts[0]);
$theTable = trim($parts[1]) ? strrev(trim($parts[1])) : $default_tablename;
if ($theTable == $tablename) {
......@@ -572,7 +572,7 @@ class BackendUtility {
if ((string)$iVal[1] !== '') {
// Find iMode
$iMode = '';
switch ((string) $fCfg['authMode']) {
switch ((string)$fCfg['authMode']) {
case 'explicitAllow':
$iMode = 'ALLOW';
break;
......@@ -821,7 +821,7 @@ class BackendUtility {
$typeNum = $GLOBALS['TCA'][$table]['types']['0'] ? 0 : 1;
}
// Force to string. Necessary for eg '-1' to be recognized as a type value.
$typeNum = (string) $typeNum;
$typeNum = (string)$typeNum;
return $typeNum;
}
......@@ -2096,7 +2096,7 @@ class BackendUtility {
$l = '';
$db = static::getDatabaseConnection();
$lang = static::getLanguageService();
switch ((string) $theColConf['type']) {
switch ((string)$theColConf['type']) {
case 'radio':
$l = self::getLabelFromItemlist($table, $col, $value);
$l = $lang->sL($l);
......@@ -2747,7 +2747,7 @@ class BackendUtility {
$urlParts = parse_url($domain);
/** @var PageRepository $sysPage */
$sysPage = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
$page = (array) $sysPage->getPage($pageId);
$page = (array)$sysPage->getPage($pageId);
$protocol = 'http';
if ($page['url_scheme'] == HttpUtility::SCHEME_HTTPS || $page['url_scheme'] == 0 && GeneralUtility::getIndpEnv('TYPO3_SSL')) {
$protocol = 'https';
......@@ -3052,14 +3052,14 @@ class BackendUtility {
if (is_array($var) && (!$dontValidateList || !GeneralUtility::inList($dontValidateList, $key))) {
// If the setting is an array or not present in the menu-array, MOD_MENU, then the default value is inserted.
if (is_array($settings[$key]) || !isset($MOD_MENU[$key][$settings[$key]])) {
$settings[$key] = (string) key($var);
$settings[$key] = (string)key($var);
$changed = 1;
}
}
// Sets default values (only strings/checkboxes, not menus)
if ($setDefaultList && !is_array($var)) {
if (GeneralUtility::inList($setDefaultList, $key) && !isset($settings[$key])) {
$settings[$key] = (string) $var;
$settings[$key] = (string)$var;
}
}
}
......
......@@ -608,7 +608,7 @@ class IconUtility {
}
$availableIcons = isset($GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'])
? (array) $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable']
? (array)$GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable']
: array();
if ($iconName !== 'empty-empty' && !in_array($iconName, $availableIcons, TRUE)) {
$iconName = 'status-status-icon-missing';
......
......@@ -56,7 +56,7 @@ class DefaultDataProvider implements DataProviderInterface {
public function getBackendLayout($identifier, $pageId) {
$backendLayout = NULL;
if ((string) $identifier === 'default') {
if ((string)$identifier === 'default') {
return $this->createDefaultBackendLayout();
}
......
......@@ -64,7 +64,7 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface {
);
if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider'])) {
$dataProviders = (array) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider'];
$dataProviders = (array)$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider'];
foreach ($dataProviders as $identifier => $className) {
$dataProviderCollection->add($identifier, $className);
}
......@@ -96,7 +96,7 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface {
*/
public function addBackendLayoutItems(array $parameters) {
$pageId = $this->determinePageId($parameters['table'], $parameters['row']);
$pageTsConfig = (array) BackendUtility::getPagesTSconfig($pageId);
$pageTsConfig = (array)BackendUtility::getPagesTSconfig($pageId);
$identifiersToBeExcluded = $this->getIdentifiersToBeExcluded($pageTsConfig);
$dataProviderContext = $this->createDataProviderContext()
......@@ -170,7 +170,7 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface {
public function getSelectedCombinedIdentifier($pageId) {
if (!isset($this->selectedCombinedIdentifier[$pageId])) {
$page = $this->getPage($pageId);
$this->selectedCombinedIdentifier[$pageId] = (string) $page['backend_layout'];
$this->selectedCombinedIdentifier[$pageId] = (string)$page['backend_layout'];
if ($this->selectedCombinedIdentifier[$pageId] === '-1') {
// If it is set to "none" - don't use any
......@@ -183,7 +183,7 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface {
array_shift($rootLine);
array_pop($rootLine);
foreach ($rootLine as $rootLinePage) {
$this->selectedCombinedIdentifier[$pageId] = (string) $rootLinePage['backend_layout_next_level'];
$this->selectedCombinedIdentifier[$pageId] = (string)$rootLinePage['backend_layout_next_level'];
if ($this->selectedCombinedIdentifier[$pageId] === '-1') {
// If layout for "next level" is set to "none" - don't use any and stop searching
$this->selectedCombinedIdentifier[$pageId] = FALSE;
......
......@@ -476,7 +476,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
$editUidList = '';
$rowArr = $contentRecordsPerColumn[$key];
$this->generateTtContentDataArray($rowArr);
foreach ((array) $rowArr as $rKey => $row) {
foreach ((array)$rowArr as $rKey => $row) {
if ($this->tt_contentConfig['languageMode']) {
$languageColumn[$key][$lP] = $head[$key] . $content[$key];
if (!$this->defLangBinding) {
......
......@@ -230,7 +230,7 @@ class Constraint extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
* @return bool
*/
public function getGroupByPage() {
return (bool) $this->groupByPage;
return (bool)$this->groupByPage;
}
/**
......@@ -325,7 +325,7 @@ class Constraint extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
* @return bool
*/
public function getIsInPageContext() {
return (bool) $this->isInPageContext;
return (bool)$this->isInPageContext;
}
/**
......
......@@ -483,9 +483,9 @@ abstract class AbstractUserAuthentication {
// If the cookie lifetime is set, use it:
$cookieExpire = $isRefreshTimeBasedCookie ? $GLOBALS['EXEC_TIME'] + $this->lifetime : 0;
// Use the secure option when the current request is served by a secure connection:
$cookieSecure = (bool) $settings['cookieSecure'] && GeneralUtility::getIndpEnv('TYPO3_SSL');
$cookieSecure = (bool)$settings['cookieSecure'] && GeneralUtility::getIndpEnv('TYPO3_SSL');
// Deliver cookies only via HTTP and prevent possible XSS by JavaScript:
$cookieHttpOnly = (bool) $settings['cookieHttpOnly'];
$cookieHttpOnly = (bool)$settings['cookieHttpOnly'];
// Do not set cookie if cookieSecure is set to "1" (force HTTPS) and no secure channel is used:
if ((int)$settings['cookieSecure'] !== 1 || GeneralUtility::getIndpEnv('TYPO3_SSL')) {
setcookie($this->name, $this->id, $cookieExpire, $cookiePath, $cookieDomain, $cookieSecure, $cookieHttpOnly);
......@@ -855,7 +855,7 @@ abstract class AbstractUserAuthentication {
);
// Re-create session entry
$insertFields = $this->getNewSessionRecord($tempuser);
$inserted = (boolean) $this->db->exec_INSERTquery($this->session_table, $insertFields);
$inserted = (bool)$this->db->exec_INSERTquery($this->session_table, $insertFields);
if (!$inserted) {
$message = 'Session data could not be written to DB. Error: ' . $this->db->sql_error();
GeneralUtility::sysLog($message, 'Core', GeneralUtility::SYSLOG_SEVERITY_WARNING);
......
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