Avoid using static access to class '\Yii' in method 'rules'. Open
['confirm_password', 'compare', 'compareAttribute' => 'password', 'message' => Yii::t('app', ('The confirm password should be consistent with password.'))],
- Read upRead up
- Create a ticketCreate a ticket
- 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 'rhopress\models\Profile' in method 'register'. Open
$profile = $user->create(Profile::className(), ['nickname' => $this->username, 'display_name' => $this->username]);
- Read upRead up
- Create a ticketCreate a ticket
- 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 'rhopress\models\Email' in method 'register'. Open
$email = $user->create(Email::className(), ['email' => $this->email]);
- Read upRead up
- Create a ticketCreate a ticket
- 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
The property $confirm_password is not named in camelCase. Open
class RegisterForm extends \yii\base\Model
{
public $username;
public $email;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Line exceeds 120 characters; contains 168 characters Open
['confirm_password', 'compare', 'compareAttribute' => 'password', 'message' => Yii::t('app', ('The confirm password should be consistent with password.'))],
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
$profile = $user->create(Profile::className(), ['nickname' => $this->username, 'display_name' => $this->username]);
- Create a ticketCreate a ticket
- Exclude checks