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
......@@ -53,7 +53,7 @@ class DebugUtility {
}
$debug = self::convertVariableToString($var);
if ($header) {
$debug = sprintf(self::DEBUG_TABLE_TEMPLATE, htmlspecialchars((string) $header), $debug);
$debug = sprintf(self::DEBUG_TABLE_TEMPLATE, htmlspecialchars((string)$header), $debug);
}
if (TYPO3_MODE === 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI)) {
$tabHeader = $header ?: 'Debug';
......@@ -108,8 +108,8 @@ class DebugUtility {
$string = '<strong>|Object:<pre>';
$string .= print_r($variable, TRUE);
$string .= '</pre>|</strong>';
} elseif ((string) $variable !== '') {
$string = '<strong>|' . htmlspecialchars((string) $variable) . '|</strong>';
} elseif ((string)$variable !== '') {
$string = '<strong>|' . htmlspecialchars((string)$variable) . '|</strong>';
} else {
$string = '<strong>| debug |</strong>';
}
......@@ -271,14 +271,14 @@ class DebugUtility {
} else {
foreach ($array_in as $key => $val) {
$result .= '<tr>
<td valign="top"><font face="Verdana,Arial" size="1">' . htmlspecialchars((string) $key) . '</font></td>
<td valign="top"><font face="Verdana,Arial" size="1">' . htmlspecialchars((string)$key) . '</font></td>
<td>';
if (is_array($val)) {
$result .= self::viewArray($val);
} elseif (is_object($val)) {
$string = '';
if (method_exists($val, '__toString')) {
$string .= get_class($val) . ': ' . (string) $val;
$string .= get_class($val) . ': ' . (string)$val;
} else {
$string .= print_r($val, TRUE);
}
......@@ -287,7 +287,7 @@ class DebugUtility {
if (gettype($val) == 'object') {
$string = 'Unknown object';
} else {
$string = (string) $val;
$string = (string)$val;
}
$result .= '<font face="Verdana,Arial" size="1" color="red">' . nl2br(htmlspecialchars($string)) . '<br /></font>';
}
......@@ -299,7 +299,7 @@ class DebugUtility {
} else {
$result = '<table border="1" cellpadding="1" cellspacing="0" bgcolor="white">
<tr>
<td><font face="Verdana,Arial" size="1" color="red">' . nl2br(htmlspecialchars((string) $array_in)) . '<br /></font></td>
<td><font face="Verdana,Arial" size="1" color="red">' . nl2br(htmlspecialchars((string)$array_in)) . '<br /></font></td>
</tr>
</table>';
}
......
......@@ -176,7 +176,7 @@ class ExtensionManagementUtility {
* Returns the real extension key like 'tt_news' from an extension prefix like 'tx_ttnews'.
*
* @param string $prefix The extension prefix (e.g. 'tx_ttnews')
* @return mixed Real extension key (string) or FALSE (boolean) if something went wrong
* @return mixed Real extension key (string)or FALSE (bool) if something went wrong
*/
static public function getExtensionKeyByPrefix($prefix) {
$result = FALSE;
......
......@@ -193,7 +193,7 @@ class BasicFileUtility {
public function checkIfFullAccess($theDest) {
$type = $this->is_webpath($theDest) ? 'webspace' : 'ftpspace';
if (isset($this->f_ext[$type])) {
if ((string) $this->f_ext[$type]['deny'] == '' || $this->f_ext[$type]['allow'] == '*') {
if ((string)$this->f_ext[$type]['deny'] == '' || $this->f_ext[$type]['allow'] == '*') {
return TRUE;
}
}
......
......@@ -492,7 +492,7 @@ class ExtendedFileUtility extends BasicFileUtility {
return FALSE;
}
// If this is TRUE, we append _XX to the file name if
$appendSuffixOnConflict = (string) $cmds['altName'];
$appendSuffixOnConflict = (string)$cmds['altName'];
$resultObject = NULL;
// Copying the file
if ($sourceFileObject instanceof File) {
......@@ -567,7 +567,7 @@ class ExtendedFileUtility extends BasicFileUtility {
$this->writelog(3, 2, 100, 'Destination "%s" was not a directory', array($cmds['target']));
return FALSE;
}
$alternativeName = (string) $cmds['altName'];
$alternativeName = (string)$cmds['altName'];
$resultObject = NULL;
// Moving the file
if ($sourceFileObject instanceof File) {
......
......@@ -342,7 +342,7 @@ class GeneralUtility {
static public function read_png_gif($theFile, $output_png = FALSE) {
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im'] && @is_file($theFile)) {
$ext = strtolower(substr($theFile, -4, 4));
if ((string) $ext == '.png' && $output_png || (string) $ext == '.gif' && !$output_png) {
if ((string)$ext == '.png' && $output_png || (string)$ext == '.gif' && !$output_png) {
return $theFile;
} else {
$newFile = PATH_site . 'typo3temp/readPG_' . md5(($theFile . '|' . filemtime($theFile))) . ($output_png ? '.png' : '.gif');
......@@ -939,7 +939,7 @@ class GeneralUtility {
* @return bool TRUE if $partStr was found to be equal to the first part of $str
*/
static public function isFirstPartOfStr($str, $partStr) {
return $partStr != '' && strpos((string) $str, (string) $partStr, 0) === 0;
return $partStr != '' && strpos((string)$str, (string)$partStr, 0) === 0;
}
/**
......@@ -1149,7 +1149,7 @@ class GeneralUtility {
* @return string Uppercase String
*/
static public function strtoupper($str) {
return strtr((string) $str, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
return strtr((string)$str, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
}
/**
......@@ -1162,7 +1162,7 @@ class GeneralUtility {
* @return string Lowercase String
*/
static public function strtolower($str) {
return strtr((string) $str, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
return strtr((string)$str, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
}
/**
......@@ -1219,7 +1219,7 @@ class GeneralUtility {
return '';
}
$isStrong = NULL;
return (string) openssl_random_pseudo_bytes($bytesToGenerate, $isStrong);
return (string)openssl_random_pseudo_bytes($bytesToGenerate, $isStrong);
}
/**
......@@ -1233,7 +1233,7 @@ class GeneralUtility {
if (!function_exists('mcrypt_create_iv')) {
return '';
}
return (string) (@mcrypt_create_iv($bytesToGenerate, $randomSource));
return (string)(@mcrypt_create_iv($bytesToGenerate, $randomSource));
}
/**
......@@ -2076,19 +2076,19 @@ 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) . '"';
$tagName = (string) $options['parentTagMap'][$stackData['parentTagName']];
$tagName = (string)$options['parentTagMap'][$stackData['parentTagName']];
} elseif (MathUtility::canBeInterpretedAsInteger($tagName)) {
// If integer...;
if ($options['useNindex']) {
......@@ -2268,9 +2268,9 @@ class GeneralUtility {
$current[$tagName] = base64_decode($val['value']);
} else {
// Had to cast it as a string - otherwise it would be evaluate FALSE if tested with isset()!!
$current[$tagName] = (string) $val['value'];
$current[$tagName] = (string)$val['value'];
// Cast type:
switch ((string) $val['attributes']['type']) {
switch ((string)$val['attributes']['type']) {
case 'integer':
$current[$tagName] = (int)$current[$tagName];
break;
......@@ -2278,7 +2278,7 @@ class GeneralUtility {
$current[$tagName] = (double) $current[$tagName];
break;
case 'boolean':
$current[$tagName] = (bool) $current[$tagName];
$current[$tagName] = (bool)$current[$tagName];
break;
case 'NULL':
$current[$tagName] = NULL;
......@@ -2944,7 +2944,7 @@ Connection: close
$dirs = self::get_dirs($path);
if ($recursivityLevels > 0 && is_array($dirs)) {
foreach ($dirs as $subdirs) {
if ((string) $subdirs != '' && (!strlen($excludePattern) || !preg_match(('/^' . $excludePattern . '$/'), $subdirs))) {
if ((string)$subdirs != '' && (!strlen($excludePattern) || !preg_match(('/^' . $excludePattern . '$/'), $subdirs))) {
$fileArr = self::getAllFilesAndFoldersInPath($fileArr, $path . $subdirs . '/', $extList, $regDirs, $recursivityLevels - 1, $excludePattern);
}
}
......@@ -3261,7 +3261,7 @@ Connection: close
- ALSO TRY the script from the ROOT of a site (like 'http://www.mytest.com/' and not 'http://www.mytest.com/test/' !!)
*/
$retVal = '';
switch ((string) $getEnvName) {
switch ((string)$getEnvName) {
case 'SCRIPT_NAME':
$retVal = self::isRunningOnCgiServerApi()
&& ($_SERVER['ORIG_PATH_INFO'] ?: $_SERVER['PATH_INFO'])
......@@ -3917,7 +3917,7 @@ Connection: close
/**
* Standard authentication code (used in Direct Mail, checkJumpUrl and setfixed links computations)
*
* @param mixed $uid_or_record Uid (integer) or record (array)
* @param mixed $uid_or_record Uid (int) or record (array)
* @param string $fields List of fields from the record if that is given.
* @param int $codeLength Length of returned authentication code.
* @return string MD5 hash of 8 chars.
......@@ -4694,7 +4694,7 @@ Connection: close
$oldPart = $part;
$partWasQuoted = $part[0] == '"';
$part = trim($part, '"');
switch ((string) $enc) {
switch ((string)$enc) {
case 'base64':
$part = '=?' . $charset . '?B?' . base64_encode($part) . '?=';
break;
......@@ -4733,7 +4733,7 @@ Connection: close
* @see makeRedirectUrl()
*/
static public function substUrlsInPlainText($message, $urlmode = '76', $index_script_url = '') {
switch ((string) $urlmode) {
switch ((string)$urlmode) {
case '':
$lengthLimit = FALSE;
break;
......@@ -5033,7 +5033,7 @@ Connection: close
$valListCnt = count($valueList);
foreach ($arr as $key => $value) {
if (!$valListCnt || in_array($key, $valueList)) {
$str .= ((string) $key . trim((': ' . self::fixed_lgd_cs(str_replace(LF, '|', (string) $value), $valueLength)))) . '; ';
$str .= ((string)$key . trim((': ' . self::fixed_lgd_cs(str_replace(LF, '|', (string)$value), $valueLength)))) . '; ';
}
}
return $str;
......
......@@ -73,7 +73,7 @@ class MathUtility {
if ($var === '' || is_object($var) || is_array($var)) {
return FALSE;
}
return (string) (int)$var === (string) $var;
return (string)(int)$var === (string)$var;
}
/**
......
......@@ -51,10 +51,10 @@ class PathUtility {
$resolvedTargetPath = '';
$sourcePathSteps = 0;
if (strlen($sourcePath) > $commonPrefixLength) {
$resolvedSourcePath = (string) substr($sourcePath, $commonPrefixLength);
$resolvedSourcePath = (string)substr($sourcePath, $commonPrefixLength);
}
if (strlen($targetPath) > $commonPrefixLength) {
$resolvedTargetPath = (string) substr($targetPath, $commonPrefixLength);
$resolvedTargetPath = (string)substr($targetPath, $commonPrefixLength);
}
if ($resolvedSourcePath !== '') {
$sourcePathSteps = count(explode('/', $resolvedSourcePath));
......
......@@ -49,7 +49,7 @@ class StringUtility {
}
$stringLength = strlen($haystack);
$needleLength = strlen($needle);
return strrpos((string) $haystack, (string) $needle, 0) === $stringLength - $needleLength;
return strrpos((string)$haystack, (string)$needle, 0) === $stringLength - $needleLength;
}
/**
......
......@@ -167,7 +167,7 @@ class VersionNumberUtility {
$parts[0] = MathUtility::forceIntegerInRange($parts[0], 0, 999);
$parts[1] = MathUtility::forceIntegerInRange($parts[1], 0, 999);
$parts[2] = MathUtility::forceIntegerInRange($parts[2], 0, 999);
switch ((string) $raise) {
switch ((string)$raise) {
case 'main':
$parts[0]++;
$parts[1] = 0;
......
......@@ -80,12 +80,12 @@ return array(
),
array(
'LLL:EXT:lang/locallang_tca.xlf:doktype.I.0',
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT,
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT,
'i/pages.gif'
),
array(
'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.4',
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_BE_USER_SECTION,
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_BE_USER_SECTION,
'i/be_users_section.gif'
),
array(
......@@ -94,17 +94,17 @@ return array(
),
array(
'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.2',
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SHORTCUT,
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SHORTCUT,
'i/pages_shortcut.gif'
),
array(
'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.5',
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_MOUNTPOINT,
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_MOUNTPOINT,
'i/pages_mountpoint.gif'
),
array(
'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.8',
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK,
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK,
'i/pages_link.gif'
),
array(
......@@ -113,21 +113,21 @@ return array(
),
array(
'LLL:EXT:lang/locallang_tca.xlf:doktype.I.folder',
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER,
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER,
'i/sysf.gif'
),
array(
'LLL:EXT:lang/locallang_tca.xlf:doktype.I.2',
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER,
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER,
'i/recycler.gif'
),
array(
'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.7',
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SPACER,
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SPACER,
'i/spacer_icon.gif'
)
),
'default' => (string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT,
'default' => (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT,
'iconsInOptionTags' => 1,
'noIconsBelowSelect' => 1
)
......@@ -822,7 +822,7 @@ return array(
),
'types' => array(
// normal
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT => array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.title;title,
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
......@@ -849,7 +849,7 @@ return array(
'
),
// external URL
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK => array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.external;external,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.title;title,
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
......@@ -872,7 +872,7 @@ return array(
'
),
// shortcut
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SHORTCUT => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SHORTCUT => array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.shortcut;shortcut,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.shortcutpage;shortcutpage,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.title;title,
......@@ -896,7 +896,7 @@ return array(
'
),
// mount page
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_MOUNTPOINT => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_MOUNTPOINT => array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.mountpoint;mountpoint,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.mountpage;mountpage,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.title;title,
......@@ -919,7 +919,7 @@ return array(
'
),
// spacer
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SPACER => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SPACER => array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.title;titleonly,
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
......@@ -931,7 +931,7 @@ return array(
'
),
// Folder
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER => array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.title;titleonly,
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
......@@ -947,7 +947,7 @@ return array(
'
),
// Trash
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER => array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.title;titleonly,
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
......
......@@ -379,7 +379,7 @@ abstract class AbstractTestCase extends \TYPO3\CMS\Core\Tests\FunctionalTestCase
if (!empty($assertion['tableName'])) {
$tableName = $assertion['tableName'];
unset($assertion['tableName']);
$elements = (array) $elements[$tableName];
$elements = (array)$elements[$tableName];
}
foreach ($elements as $element) {
......
......@@ -269,7 +269,7 @@ abstract class FunctionalTestCase extends BaseTestCase {
} elseif (isset($column['is-NULL']) && ($column['is-NULL'] === 'yes')) {
$columnValue = NULL;
} else {
$columnValue = (string) $table->$columnName;
$columnValue = (string)$table->$columnName;
}
$insertArray[$columnName] = $columnValue;
......@@ -284,7 +284,7 @@ abstract class FunctionalTestCase extends BaseTestCase {
);
}
if (isset($table['id'])) {
$elementId = (string) $table['id'];
$elementId = (string)$table['id'];
$foreignKeys[$tableName][$elementId] = $database->sql_insert_id();
}
}
......
......@@ -315,7 +315,7 @@ class BackendUserAuthenticationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
array_walk(
$expectedPermissions,
function(&$value) {
$value = (bool) $value;
$value = (bool)$value;
}
);
......
......@@ -139,9 +139,9 @@ class ApplicationContextTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
public function parentContextIsConnectedRecursively() {
$context = new ApplicationContext('Production/Foo/Bar');
$parentContext = $context->getParent();
$this->assertSame('Production/Foo', (string) $parentContext);
$this->assertSame('Production/Foo', (string)$parentContext);
$rootContext = $parentContext->getParent();
$this->assertSame('Production', (string) $rootContext);
$this->assertSame('Production', (string)$rootContext);
}
}
......@@ -148,7 +148,7 @@ class LogRecordTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
public function toStringIncludesDataAsJson() {
$dataArray = array('foo' => 'bar');
$record = $this->getRecord(array('data' => $dataArray));
$this->assertContains(json_encode($dataArray), (string) $record);
$this->assertContains(json_encode($dataArray), (string)$record);
}
}
......@@ -122,8 +122,8 @@ class FileWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
$simpleRecord = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogRecord', uniqid('test.core.log.fileWriter.simpleRecord.'), \TYPO3\CMS\Core\Log\LogLevel::INFO, 'test record');
$recordWithData = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogRecord', uniqid('test.core.log.fileWriter.recordWithData.'), \TYPO3\CMS\Core\Log\LogLevel::ALERT, 'test record with data', array('foo' => array('bar' => 'baz')));
return array(
'simple record' => array($simpleRecord, trim((string) $simpleRecord)),
'record with data' => array($recordWithData, trim((string) $recordWithData))
'simple record' => array($simpleRecord, trim((string)$simpleRecord)),
'record with data' => array($recordWithData, trim((string)$recordWithData))
);
}
......
......@@ -10,23 +10,23 @@ defined('TYPO3_MODE') or die();
* types, and for every type the entries simply overrides the entries in the 'default' type!
*/
$GLOBALS['PAGES_TYPES'] = array(
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK => array(),
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SHORTCUT => array(),
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_BE_USER_SECTION => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK => array(),
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SHORTCUT => array(),
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_BE_USER_SECTION => array(
'type' => 'web',
'allowedTables' => '*'
),
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_MOUNTPOINT => array(),
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SPACER => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_MOUNTPOINT => array(),
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SPACER => array(
'type' => 'sys'
),
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER => array(
// Doktype 254 is a 'Folder' - a general purpose storage folder for whatever you like.
// In CMS context it's NOT a viewable page. Can contain any element.
'type' => 'sys',
'allowedTables' => '*'
),
(string) \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER => array(
(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER => array(
// Doktype 255 is a recycle-bin.
'type' => 'sys',
'allowedTables' => '*'
......
......@@ -256,7 +256,7 @@ updateQryForm(\'' . $input['QUERY'] . '\');
*/
protected function printCachedInfo() {
// Get cmd:
if ((string) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cmd') === 'clear') {
if ((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cmd') === 'clear') {
$GLOBALS['TYPO3_DB']->clearCachedFieldInfo();
$GLOBALS['TYPO3_DB']->cacheFieldInfo();
}
......@@ -336,7 +336,7 @@ updateQryForm(\'' . $input['QUERY'] . '\');
// Disable debugging in any case...
$GLOBALS['TYPO3_DB']->debug = FALSE;
// Get cmd:
$cmd = (string) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cmd');
$cmd = (string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cmd');
switch ($cmd) {
case 'flush':
$res = $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('tx_dbal_debuglog');
......
......@@ -628,7 +628,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
}
// Select API
$this->lastHandlerKey = $this->handler_getFromTableList($table);
$hType = (string) $this->handlerCfg[$this->lastHandlerKey]['type'];
$hType = (string)$this->handlerCfg[$this->lastHandlerKey]['type'];
$sqlResult = NULL;
switch ($hType) {
case 'native':
......@@ -709,7 +709,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
}
// Select API
$this->lastHandlerKey = $this->handler_getFromTableList($table);
$hType = (string) $this->handlerCfg[$this->lastHandlerKey]['type'];
$hType = (string)$this->handlerCfg[$this->lastHandlerKey]['type'];
$sqlResult = NULL;
switch ($hType) {
case 'native':
......@@ -772,7 +772,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
$fromTable = $from_table;
}
$this->lastHandlerKey = $this->handler_getFromTableList($fromTable);
$hType = (string) $this->handlerCfg[$this->lastHandlerKey]['type'];
$hType = (string)$this->handlerCfg[$this->lastHandlerKey]['type'];
$sqlResult = NULL;
switch ($hType) {
case 'native':
......@@ -861,7 +861,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
}
// Select API
$this->lastHandlerKey = $this->handler_getFromTableList($table);
$hType = (string) $this->handlerCfg[$this->lastHandlerKey]['type'];
$hType = (string)$this->handlerCfg[$this->lastHandlerKey]['type'];
$sqlResult = NULL;
switch ($hType) {
case 'native':
......@@ -1056,7 +1056,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
* @return string|array Full SQL query for INSERT (unless $rows does not contain any elements in which case it will be FALSE)
*/
public function INSERTmultipleRows($table, array $fields, array $rows, $no_quote_fields = FALSE) {
if ((string) $this->handlerCfg[$this->lastHandlerKey]['type'] === 'native') {
if ((string)$this->handlerCfg[$this->lastHandlerKey]['type'] === 'native') {
return parent::INSERTmultipleRows($table, $fields, $rows, $no_quote_fields);
}
$result = array();
......@@ -1196,7 +1196,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
*/
public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '') {
$this->lastHandlerKey = $this->handler_getFromTableList($from_table);
$hType = (string) $this->handlerCfg[$this->lastHandlerKey]['type'];
$hType = (string)$this->handlerCfg[$this->lastHandlerKey]['type'];