Skip to content

Commit

Permalink
clear code
Browse files Browse the repository at this point in the history
  • Loading branch information
lav45 committed Jun 1, 2024
1 parent bcc499b commit a6e4e0b
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 31 deletions.
1 change: 0 additions & 1 deletion build/controllers/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
namespace yii\build\controllers;

use DirectoryIterator;
use Yii;
use yii\console\Controller;
use yii\helpers\Html;

Expand Down
2 changes: 0 additions & 2 deletions framework/base/ErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

namespace yii\base;

use Yii;

/**
* ErrorException represents a PHP error.
*
Expand Down
1 change: 0 additions & 1 deletion framework/base/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\base;

use Yii;
use yii\helpers\StringHelper;

/**
Expand Down
5 changes: 0 additions & 5 deletions framework/data/ActiveDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ protected function prepareModels()
if (($sort = $this->getSort()) !== false) {
$query->addOrderBy($sort->getOrders());
}

return $query->all($this->db);
}

Expand All @@ -129,7 +128,6 @@ protected function prepareKeys($models)
$keys[] = call_user_func($this->key, $model);
}
}

return $keys;
} elseif ($this->query instanceof ActiveQueryInterface) {
/* @var $class \yii\db\ActiveRecordInterface */
Expand All @@ -149,10 +147,8 @@ protected function prepareKeys($models)
$keys[] = $kk;
}
}

return $keys;
}

return array_keys($models);
}

Expand Down Expand Up @@ -220,7 +216,6 @@ public function __clone()
if (is_object($this->query)) {
$this->query = clone $this->query;
}

parent::__clone();
}
}
9 changes: 1 addition & 8 deletions framework/data/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ public function getPage($recalculate = false)
$page = (int) $this->getQueryParam($this->pageParam, 1) - 1;
$this->setPage($page, true);
}

return $this->_page;
}

Expand Down Expand Up @@ -221,7 +220,6 @@ public function getPageSize()
$this->setPageSize($pageSize, true);
}
}

return $this->_pageSize;
}

Expand Down Expand Up @@ -264,7 +262,7 @@ public function createUrl($page, $pageSize = null, $absolute = false)
$request = Yii::$app->getRequest();
$params = $request instanceof Request ? $request->getQueryParams() : [];
}
if ($page > 0 || $page == 0 && $this->forcePageParam) {
if ($page > 0 || ($page === 0 && $this->forcePageParam)) {
$params[$this->pageParam] = $page + 1;
} else {
unset($params[$this->pageParam]);
Expand All @@ -282,7 +280,6 @@ public function createUrl($page, $pageSize = null, $absolute = false)
if ($absolute) {
return $urlManager->createAbsoluteUrl($params);
}

return $urlManager->createUrl($params);
}

Expand All @@ -293,7 +290,6 @@ public function createUrl($page, $pageSize = null, $absolute = false)
public function getOffset()
{
$pageSize = $this->getPageSize();

return $pageSize < 1 ? 0 : $this->getPage() * $pageSize;
}

Expand All @@ -305,7 +301,6 @@ public function getOffset()
public function getLimit()
{
$pageSize = $this->getPageSize();

return $pageSize < 1 ? -1 : $pageSize;
}

Expand All @@ -331,7 +326,6 @@ public function getLinks($absolute = false)
$links[self::LINK_NEXT] = $this->createUrl($currentPage + 1, null, $absolute);
}
}

return $links;
}

Expand All @@ -348,7 +342,6 @@ protected function getQueryParam($name, $defaultValue = null)
$request = Yii::$app->getRequest();
$params = $request instanceof Request ? $request->getQueryParams() : [];
}

return isset($params[$name]) && is_scalar($params[$name]) ? $params[$name] : $defaultValue;
}

Expand Down
3 changes: 0 additions & 3 deletions framework/data/SqlDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\data;

use Yii;
use yii\base\InvalidConfigException;
use yii\caching\ArrayCache;
use yii\db\Connection;
Expand Down Expand Up @@ -151,10 +150,8 @@ protected function prepareKeys($models)
$keys[] = call_user_func($this->key, $model);
}
}

return $keys;
}

return array_keys($models);
}

Expand Down
1 change: 0 additions & 1 deletion framework/db/ColumnSchemaBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\db;

use Yii;
use yii\base\BaseObject;
use yii\helpers\StringHelper;

Expand Down
1 change: 0 additions & 1 deletion framework/i18n/DbMessageSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\i18n;

use Yii;
use yii\base\InvalidConfigException;
use yii\caching\CacheInterface;
use yii\db\Connection;
Expand Down
1 change: 0 additions & 1 deletion framework/log/DbTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\log;

use Yii;
use yii\base\InvalidConfigException;
use yii\db\Connection;
use yii\db\Exception;
Expand Down
1 change: 0 additions & 1 deletion framework/log/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\log;

use Yii;
use yii\base\Component;

/**
Expand Down
1 change: 0 additions & 1 deletion framework/log/SyslogTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\log;

use Yii;
use yii\helpers\VarDumper;

/**
Expand Down
1 change: 0 additions & 1 deletion framework/rbac/Assignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\rbac;

use Yii;
use yii\base\BaseObject;

/**
Expand Down
1 change: 0 additions & 1 deletion framework/rest/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\rest;

use Yii;
use yii\base\InvalidConfigException;
use yii\db\ActiveRecordInterface;
use yii\web\NotFoundHttpException;
Expand Down
2 changes: 0 additions & 2 deletions framework/rest/ViewAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

namespace yii\rest;

use Yii;

/**
* ViewAction implements the API endpoint for returning the detailed information about a model.
*
Expand Down
1 change: 0 additions & 1 deletion framework/web/CacheSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\web;

use Yii;
use yii\caching\CacheInterface;
use yii\di\Instance;

Expand Down
1 change: 0 additions & 1 deletion framework/web/HeaderCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace yii\web;

use Yii;
use yii\base\BaseObject;

/**
Expand Down

0 comments on commit a6e4e0b

Please sign in to comment.