Showing 30 of 30 total issues
Avoid using static access to class '\Yii' in method 'initCachePath'. Open
$cachePath = empty($this->cachePath) ? false : Yii::getAlias($this->cachePath);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Yii' in method 'init'. Open
throw new Exception(Yii::t('app', 'Pug cache path is not readable.'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\yii\helpers\FileHelper' in method 'initCachePath'. Open
FileHelper::createDirectory($cachePath);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Yii' in method 'init'. Open
throw new Exception(Yii::t('app', 'Pug cache path is not writable.'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Yii' in method 'init'. Open
$baseDir = realpath(Yii::getAlias($this->viewPath));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Yii' in method 'render'. Open
$path = realpath(Yii::getAlias($this->viewPath));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Class extends undeclared class \yii\base\ViewRenderer
(Did you mean class \Pug\Yii\ViewRenderer) Open
class ViewRenderer extends YiiViewRenderer
- Exclude checks
Call to method getAlias
from undeclared class \Yii
Open
$baseDir = realpath(Yii::getAlias($this->viewPath));
- Exclude checks
Checking instanceof against undeclared class \Phug\Renderer
Open
if ($this->pug instanceof \Tale\Pug\Renderer && !($this->pug instanceof \Phug\Renderer)) {
- Exclude checks
Class extends undeclared class \yii\base\Exception
(Did you mean class \Exception or class \Pug\Yii\Exception) Open
class Exception extends YiiException
- Exclude checks
Call to method getAlias
from undeclared class \Yii
Open
$cachePath = empty($this->cachePath) ? false : Yii::getAlias($this->cachePath);
- Exclude checks
Call to method createDirectory
from undeclared class \yii\helpers\FileHelper
Open
FileHelper::createDirectory($cachePath);
- Exclude checks
Parameter $view
has undeclared type \yii\base\View
Open
public function render($view, $file, $params)
- Exclude checks
Call to method filter
from undeclared class \Pug\Pug
Open
$this->pug->filter($name, $handler);
- Exclude checks
Rename "$cachePath" which has the same name as the field declared at line 29. Open
$cachePath = empty($this->cachePath) ? false : Yii::getAlias($this->cachePath);
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Call to method getAlias
from undeclared class \Yii
Open
$path = realpath(Yii::getAlias($this->viewPath));
- Exclude checks
Rename "$cachePath" which has the same name as the field declared at line 29. Open
$cachePath = $this->initCachePath();
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
@throws type of init
has undeclared type \yii\base\Exception
(Did you mean class \Exception) Open
public function init()
- Exclude checks
Call with 1 arg(s) to \Pug\Yii\Exception::__construct()
which only takes 0 arg(s) defined at /code/Exception.php:13
Open
throw new Exception(Yii::t('app', 'Pug cache path is not readable.'));
- Exclude checks
Call to method t
from undeclared class \Yii
Open
throw new Exception(Yii::t('app', 'Pug cache path is not writable.'));
- Exclude checks