Commit 4a201c7a by Alexander Makarov

Removed unused variables

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