diff --git a/framework/console/ErrorHandler.php b/framework/console/ErrorHandler.php index 16127a1..ddea40a 100644 --- a/framework/console/ErrorHandler.php +++ b/framework/console/ErrorHandler.php @@ -9,7 +9,6 @@ namespace yii\console; use Yii; use yii\base\ErrorException; -use yii\base\UserException; use yii\helpers\Console; /** @@ -39,7 +38,7 @@ class ErrorHandler extends \yii\base\ErrorHandler } elseif (count($alternatives) > 1) { $message .= "\n\nDid you mean one of these?\n - " . implode("\n - ", $alternatives); } - } elseif ($exception instanceof Exception && ($exception instanceof UserException || !YII_DEBUG)) { + } elseif ($exception instanceof Exception || !YII_DEBUG) { $message = $this->formatMessage($exception->getName() . ': ') . $exception->getMessage(); } elseif (YII_DEBUG) { if ($exception instanceof Exception) { diff --git a/framework/data/DataFilter.php b/framework/data/DataFilter.php index 6af8447..c07e2a8 100644 --- a/framework/data/DataFilter.php +++ b/framework/data/DataFilter.php @@ -355,7 +355,7 @@ class DataFilter extends Model /** * Detect attribute type from given validator. * - * @param Validator validator from which to detect attribute type. + * @param Validator $validator validator from which to detect attribute type. * @return string|null detected attribute type. * @since 2.0.14 */ diff --git a/framework/db/SqlToken.php b/framework/db/SqlToken.php index 0e947c1..fa57068 100644 --- a/framework/db/SqlToken.php +++ b/framework/db/SqlToken.php @@ -267,10 +267,8 @@ class SqlToken extends BaseObject implements \ArrayAccess if ($firstMatchIndex === null) { $firstMatchIndex = $offset; - $lastMatchIndex = $offset; - } else { - $lastMatchIndex = $offset; } + $lastMatchIndex = $offset; $wildcard = false; $offset++; continue 2; diff --git a/framework/db/mssql/QueryBuilder.php b/framework/db/mssql/QueryBuilder.php index 6b6c89c..79c5d3d 100644 --- a/framework/db/mssql/QueryBuilder.php +++ b/framework/db/mssql/QueryBuilder.php @@ -108,7 +108,7 @@ class QueryBuilder extends \yii\db\QueryBuilder * Builds the ORDER BY/LIMIT/OFFSET clauses for SQL SERVER 2005 to 2008. * @param string $sql the existing SQL (without ORDER BY/LIMIT/OFFSET) * @param array $orderBy the order by columns. See [[\yii\db\Query::orderBy]] for more details on how to specify this parameter. - * @param int $limit the limit number. See [[\yii\db\Query::limit]] for more details. + * @param int|Expression $limit the limit number. See [[\yii\db\Query::limit]] for more details. * @param int $offset the offset number. See [[\yii\db\Query::offset]] for more details. * @return string the SQL completed with ORDER BY/LIMIT/OFFSET (if any) */ diff --git a/framework/i18n/GettextMessageSource.php b/framework/i18n/GettextMessageSource.php index 251bd7f..d96fb52 100644 --- a/framework/i18n/GettextMessageSource.php +++ b/framework/i18n/GettextMessageSource.php @@ -113,7 +113,7 @@ class GettextMessageSource extends MessageSource } elseif (!empty($fallbackMessages)) { foreach ($fallbackMessages as $key => $value) { if (!empty($value) && empty($messages[$key])) { - $messages[$key] = $fallbackMessages[$key]; + $messages[$key] = $value; } } } diff --git a/framework/i18n/PhpMessageSource.php b/framework/i18n/PhpMessageSource.php index 9758468..4bcfcd9 100644 --- a/framework/i18n/PhpMessageSource.php +++ b/framework/i18n/PhpMessageSource.php @@ -115,7 +115,7 @@ class PhpMessageSource extends MessageSource } elseif (!empty($fallbackMessages)) { foreach ($fallbackMessages as $key => $value) { if (!empty($value) && empty($messages[$key])) { - $messages[$key] = $fallbackMessages[$key]; + $messages[$key] = $value; } } } diff --git a/framework/log/Target.php b/framework/log/Target.php index 2a192e8..819669e 100644 --- a/framework/log/Target.php +++ b/framework/log/Target.php @@ -11,7 +11,6 @@ use Yii; use yii\base\Component; use yii\base\InvalidConfigException; use yii\helpers\ArrayHelper; -use yii\helpers\StringHelper; use yii\helpers\VarDumper; use yii\web\Request; diff --git a/framework/mutex/PgsqlMutex.php b/framework/mutex/PgsqlMutex.php index 8c38c75..900ac5f 100644 --- a/framework/mutex/PgsqlMutex.php +++ b/framework/mutex/PgsqlMutex.php @@ -7,7 +7,6 @@ namespace yii\mutex; -use yii\base\InvalidArgumentException; use yii\base\InvalidConfigException; /** diff --git a/framework/requirements/views/console/index.php b/framework/requirements/views/console/index.php index d1559b6..68c4cb5 100644 --- a/framework/requirements/views/console/index.php +++ b/framework/requirements/views/console/index.php @@ -23,7 +23,6 @@ echo str_pad('', strlen($header), '-') . "\n\n"; foreach ($requirements as $key => $requirement) { if ($requirement['condition']) { echo $requirement['name'] . ": OK\n"; - echo "\n"; } else { echo $requirement['name'] . ': ' . ($requirement['mandatory'] ? 'FAILED!!!' : 'WARNING!!!') . "\n"; echo 'Required by: ' . strip_tags($requirement['by']) . "\n"; @@ -31,8 +30,8 @@ foreach ($requirements as $key => $requirement) { if (!empty($memo)) { echo 'Memo: ' . strip_tags($requirement['memo']) . "\n"; } - echo "\n"; } + echo "\n"; } $summaryString = 'Errors: ' . $summary['errors'] . ' Warnings: ' . $summary['warnings'] . ' Total checks: ' . $summary['total']; diff --git a/framework/widgets/MaskedInput.php b/framework/widgets/MaskedInput.php index 6c02f1d..632af1f 100644 --- a/framework/widgets/MaskedInput.php +++ b/framework/widgets/MaskedInput.php @@ -8,7 +8,6 @@ namespace yii\widgets; use yii\base\InvalidConfigException; -use yii\helpers\Html; use yii\helpers\Json; use yii\web\JsExpression; use yii\web\View;