From b0ef4c9084819f7a32e482e4a5a0fb5a5ef1fb5a Mon Sep 17 00:00:00 2001 From: Alexander Makarov <sam@rmcreative.ru> Date: Tue, 4 Mar 2014 21:40:31 +0400 Subject: [PATCH] Removed unused variables --- build/controllers/ClassmapController.php | 2 +- extensions/gii/generators/model/Generator.php | 2 +- framework/BaseYii.php | 2 +- framework/helpers/BaseHtml.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/controllers/ClassmapController.php b/build/controllers/ClassmapController.php index 706435a..5fd4e5f 100644 --- a/build/controllers/ClassmapController.php +++ b/build/controllers/ClassmapController.php @@ -52,7 +52,7 @@ class ClassmapController extends Controller $files = FileHelper::findFiles($root, $options); $map = []; foreach ($files as $file) { - if (($pos = strpos($file, $root)) !== 0) { + if (strpos($file, $root) !== 0) { die("Something wrong: $file\n"); } $path = str_replace('\\', '/', substr($file, strlen($root))); diff --git a/extensions/gii/generators/model/Generator.php b/extensions/gii/generators/model/Generator.php index 538637c..893cd7f 100644 --- a/extensions/gii/generators/model/Generator.php +++ b/extensions/gii/generators/model/Generator.php @@ -471,7 +471,7 @@ class Generator extends \yii\gii\Generator */ public function validateTableName() { - if (($pos = strpos($this->tableName, '*')) !== false && substr($this->tableName, -1) !== '*') { + if (strpos($this->tableName, '*') !== false && substr($this->tableName, -1) !== '*') { $this->addError('tableName', 'Asterisk is only allowed as the last character.'); return; } diff --git a/framework/BaseYii.php b/framework/BaseYii.php index 9152afc..c70808e 100644 --- a/framework/BaseYii.php +++ b/framework/BaseYii.php @@ -356,7 +356,7 @@ class BaseYii $config = array_merge(static::$objectConfig[$class], $config); } - if (($n = func_num_args()) > 1) { + if (func_num_args() > 1) { /** @var \ReflectionClass $reflection */ if (isset($reflections[$class])) { $reflection = $reflections[$class]; diff --git a/framework/helpers/BaseHtml.php b/framework/helpers/BaseHtml.php index 01151ec..4e761fa 100644 --- a/framework/helpers/BaseHtml.php +++ b/framework/helpers/BaseHtml.php @@ -1579,7 +1579,7 @@ class BaseHtml { if (isset($options['class'])) { $classes = ' ' . $options['class'] . ' '; - if (($pos = strpos($classes, ' ' . $class . ' ')) === false) { + if (strpos($classes, ' ' . $class . ' ') === false) { $options['class'] .= ' ' . $class; } } else { -- libgit2 0.27.1