Commit 4a201c7a by Alexander Makarov

Removed unused variables

parent dd26d39d
...@@ -63,7 +63,7 @@ class PropertyDoc extends BaseDoc ...@@ -63,7 +63,7 @@ class PropertyDoc extends BaseDoc
$this->defaultValue = PrettyPrinter::getRepresentationOfValue($reflector->getNode()->default); $this->defaultValue = PrettyPrinter::getRepresentationOfValue($reflector->getNode()->default);
} }
foreach($this->tags as $i => $tag) { foreach($this->tags as $tag) {
if ($tag instanceof VarTag) { if ($tag instanceof VarTag) {
$this->type = $tag->getType(); $this->type = $tag->getType();
$this->types = $tag->getTypes(); $this->types = $tag->getTypes();
......
...@@ -315,7 +315,7 @@ class AuthAction extends Action ...@@ -315,7 +315,7 @@ class AuthAction extends Action
return Yii::$app->getResponse()->redirect($url); return Yii::$app->getResponse()->redirect($url);
} else { } else {
// Upgrade to access token. // Upgrade to access token.
$accessToken = $client->fetchAccessToken(); $client->fetchAccessToken();
return $this->authSuccess($client); return $this->authSuccess($client);
} }
} }
......
...@@ -252,7 +252,7 @@ class Generator extends \yii\gii\Generator ...@@ -252,7 +252,7 @@ class Generator extends \yii\gii\Generator
try { try {
$db = $this->getDbConnection(); $db = $this->getDbConnection();
$uniqueIndexes = $db->getSchema()->findUniqueIndexes($table); $uniqueIndexes = $db->getSchema()->findUniqueIndexes($table);
foreach ($uniqueIndexes as $indexName => $uniqueColumns) { foreach ($uniqueIndexes as $uniqueColumns) {
// Avoid validating auto incrementable columns // Avoid validating auto incrementable columns
if (!$this->isUniqueColumnAutoIncrementable($table, $uniqueColumns)) { if (!$this->isUniqueColumnAutoIncrementable($table, $uniqueColumns)) {
$attributesCount = count($uniqueColumns); $attributesCount = count($uniqueColumns);
......
...@@ -288,7 +288,7 @@ class ActiveQuery extends \yii\base\Component implements ActiveQueryInterface ...@@ -288,7 +288,7 @@ class ActiveQuery extends \yii\base\Component implements ActiveQueryInterface
if (count($this->where) == 1) { if (count($this->where) == 1) {
$pks = (array) reset($this->where); $pks = (array) reset($this->where);
} else { } else {
foreach($this->where as $column => $values) { foreach($this->where as $values) {
if (is_array($values)) { if (is_array($values)) {
// TODO support composite IN for composite PK // TODO support composite IN for composite PK
throw new NotSupportedException('Find by composite PK is not supported by redis ActiveRecord.'); throw new NotSupportedException('Find by composite PK is not supported by redis ActiveRecord.');
......
...@@ -336,7 +336,7 @@ EOF; ...@@ -336,7 +336,7 @@ EOF;
} }
$columnAlias = $this->addColumn($column, $columns); $columnAlias = $this->addColumn($column, $columns);
$parts = []; $parts = [];
foreach ($values as $i => $value) { foreach ($values as $value) {
if (is_array($value)) { if (is_array($value)) {
$value = isset($value[$column]) ? $value[$column] : null; $value = isset($value[$column]) ? $value[$column] : null;
} }
......
...@@ -379,7 +379,6 @@ class ActiveRecordTest extends ElasticSearchTestCase ...@@ -379,7 +379,6 @@ class ActiveRecordTest extends ElasticSearchTestCase
public function testFindAsArrayFields() public function testFindAsArrayFields()
{ {
$customerClass = $this->getCustomerClass();
/** @var TestCase|ActiveRecordTestTrait $this */ /** @var TestCase|ActiveRecordTestTrait $this */
// indexBy + asArray // indexBy + asArray
$customers = $this->callCustomerFind()->asArray()->fields(['id', 'name'])->all(); $customers = $this->callCustomerFind()->asArray()->fields(['id', 'name'])->all();
...@@ -454,7 +453,6 @@ class ActiveRecordTest extends ElasticSearchTestCase ...@@ -454,7 +453,6 @@ class ActiveRecordTest extends ElasticSearchTestCase
public function testFindIndexByAsArrayFields() public function testFindIndexByAsArrayFields()
{ {
$customerClass = $this->getCustomerClass();
/** @var TestCase|ActiveRecordTestTrait $this */ /** @var TestCase|ActiveRecordTestTrait $this */
// indexBy + asArray // indexBy + asArray
$customers = $this->callCustomerFind()->indexBy('name')->asArray()->fields('id', 'name')->all(); $customers = $this->callCustomerFind()->indexBy('name')->asArray()->fields('id', 'name')->all();
......
...@@ -206,7 +206,6 @@ trait ActiveRecordTestTrait ...@@ -206,7 +206,6 @@ trait ActiveRecordTestTrait
public function testfindIndexByAsArray() public function testfindIndexByAsArray()
{ {
$customerClass = $this->getCustomerClass();
/** @var TestCase|ActiveRecordTestTrait $this */ /** @var TestCase|ActiveRecordTestTrait $this */
// indexBy + asArray // indexBy + asArray
$customers = $this->callCustomerFind()->asArray()->indexBy('name')->all(); $customers = $this->callCustomerFind()->asArray()->indexBy('name')->all();
......
...@@ -13,7 +13,7 @@ class PostgreSQLConnectionTest extends ConnectionTest ...@@ -13,7 +13,7 @@ class PostgreSQLConnectionTest extends ConnectionTest
public function testConnection() public function testConnection()
{ {
$connection = $this->getConnection(true); $this->getConnection(true);
} }
public function testQuoteValue() public function testQuoteValue()
......
...@@ -162,7 +162,7 @@ class CompareValidatorTest extends TestCase ...@@ -162,7 +162,7 @@ class CompareValidatorTest extends TestCase
$this->assertTrue(strlen($val->message) > 1); $this->assertTrue(strlen($val->message) > 1);
} }
try { try {
$val = new CompareValidator(['operator' => '<>']); new CompareValidator(['operator' => '<>']);
} catch (InvalidConfigException $e) { } catch (InvalidConfigException $e) {
return; return;
} }
......
...@@ -28,7 +28,7 @@ class ExistValidatorTest extends DatabaseTestCase ...@@ -28,7 +28,7 @@ class ExistValidatorTest extends DatabaseTestCase
{ {
try { try {
$val = new ExistValidator(); $val = new ExistValidator();
$result = $val->validate('ref'); $val->validate('ref');
$this->fail('Exception should have been thrown at this time'); $this->fail('Exception should have been thrown at this time');
} catch (Exception $e) { } catch (Exception $e) {
$this->assertInstanceOf('yii\base\InvalidConfigException', $e); $this->assertInstanceOf('yii\base\InvalidConfigException', $e);
......
...@@ -18,7 +18,7 @@ class FilterValidatorTest extends TestCase ...@@ -18,7 +18,7 @@ class FilterValidatorTest extends TestCase
public function testAssureExceptionOnInit() public function testAssureExceptionOnInit()
{ {
$this->setExpectedException('yii\base\InvalidConfigException'); $this->setExpectedException('yii\base\InvalidConfigException');
$val = new FilterValidator(); new FilterValidator();
} }
public function testValidateAttribute() public function testValidateAttribute()
......
...@@ -18,7 +18,7 @@ class RangeValidatorTest extends TestCase ...@@ -18,7 +18,7 @@ class RangeValidatorTest extends TestCase
public function testInitException() public function testInitException()
{ {
$this->setExpectedException('yii\base\InvalidConfigException', 'The "range" property must be set.'); $this->setExpectedException('yii\base\InvalidConfigException', 'The "range" property must be set.');
$val = new RangeValidator(['range' => 'not an array']); new RangeValidator(['range' => 'not an array']);
} }
public function testAssureMessageSetOnInit() public function testAssureMessageSetOnInit()
......
...@@ -31,6 +31,6 @@ class CacheSessionTest extends \yiiunit\TestCase ...@@ -31,6 +31,6 @@ class CacheSessionTest extends \yiiunit\TestCase
public function testInvalidCache() public function testInvalidCache()
{ {
$this->setExpectedException('yii\base\InvalidConfigException'); $this->setExpectedException('yii\base\InvalidConfigException');
$session = new CacheSession(['cache' => 'invalid']); new CacheSession(['cache' => 'invalid']);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment