[minor]: SCA (#16269)

* Php Inspections (EA Ultimate): minor code tweaks

* Php Inspections (EA Ultimate): code style

* Php Inspections (EA Ultimate): code style

* Php Inspections (EA Ultimate): code style
This commit is contained in:
Vladimir Reznichenko
2018-05-14 11:00:01 +02:00
committed by Alexander Makarov
parent 643ef6f820
commit 6dd2aec011
4 changed files with 19 additions and 23 deletions

View File

@ -353,8 +353,7 @@ trait ActiveRelationTrait
}
}
}
} else {
if ($this->multiple) {
} elseif ($this->multiple) {
foreach ($primaryModels as $i => $primaryModel) {
foreach ($primaryModel[$primaryName] as $j => $m) {
if ($m instanceof ActiveRecordInterface) {
@ -374,7 +373,6 @@ trait ActiveRelationTrait
}
}
}
}
/**
* @param array $models

View File

@ -621,7 +621,7 @@ SQL;
} else {
$returnParams[$phName]['dataType'] = \PDO::PARAM_INT;
}
$returnParams[$phName]['size'] = isset($columnSchemas[$name]) && isset($columnSchemas[$name]->size) ? $columnSchemas[$name]->size : -1;
$returnParams[$phName]['size'] = isset($columnSchemas[$name]->size) ? $columnSchemas[$name]->size : -1;
$returning[] = $this->quoteColumnName($name);
}
$sql .= ' RETURNING ' . implode(', ', $returning) . ' INTO ' . implode(', ', array_keys($returnParams));

View File

@ -937,7 +937,7 @@ class Request extends \yii\base\Request
throw new InvalidConfigException('Unable to determine the path info of the current request.');
}
if (substr($pathInfo, 0, 1) === '/') {
if (strncmp($pathInfo, '/', 1) === 0) {
$pathInfo = substr($pathInfo, 1);
}

View File

@ -814,14 +814,12 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
$_SESSION[$this->flashParam] = $counters;
if (empty($_SESSION[$key])) {
$_SESSION[$key] = [$value];
} else {
if (is_array($_SESSION[$key])) {
} elseif (is_array($_SESSION[$key])) {
$_SESSION[$key][] = $value;
} else {
$_SESSION[$key] = [$_SESSION[$key], $value];
}
}
}
/**
* Removes a flash message.