Merge pull request #15549 from Tithugues/fix/replace-gettype-by-is-functions

Use is_* functions instead of gettype
This commit is contained in:
Maurício Meneghini Fauth 2019-11-01 20:40:56 -03:00 committed by GitHub
commit 5b72d832cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -3796,7 +3796,7 @@ class Results
$is_analyse = $this->__get('is_analyse');
$field_flags = $GLOBALS['dbi']->fieldFlags($dt_result, $col_index);
$bIsText = gettype($transformation_plugin) === 'object'
$bIsText = is_object($transformation_plugin)
&& strpos($transformation_plugin->getMIMEType(), 'Text')
=== false;
@ -3828,7 +3828,7 @@ class Results
// Cut all fields to $GLOBALS['cfg']['LimitChars']
// (unless it's a link-type transformation or binary)
$displayedColumn = $column;
if (! (gettype($transformation_plugin) === "object"
if (! (is_object($transformation_plugin)
&& strpos($transformation_plugin->getName(), 'Link') !== false)
&& false === stripos($field_flags, self::BINARY_FIELD)
) {
@ -5076,7 +5076,7 @@ class Results
$result .= ']';
// if we want to use a text transformation on a BLOB column
if (gettype($transformation_plugin) === "object") {
if (is_object($transformation_plugin)) {
$posMimeOctetstream = strpos(
$transformation_plugin->getMIMESubtype(),
'Octetstream'

View File

@ -425,7 +425,7 @@ class Error extends Message
if (in_array($function, $include_functions)) {
$retval .= self::relPath($arg);
} elseif (in_array($function, $connect_functions)
&& gettype($arg) === 'string'
&& is_string($arg)
) {
$retval .= gettype($arg) . ' ********';
} elseif (is_scalar($arg)) {

View File

@ -643,7 +643,7 @@ class Sql
$property_value,
$_POST['table_create_time']
);
if (gettype($retval) != 'boolean') {
if (! is_bool($retval)) {
$response = Response::getInstance();
$response->setRequestStatus(false);
$response->addJSON('message', $retval->getString());