rhosocial/yii2-base-models

View on GitHub
traits/PasswordTrait.php

Summary

Maintainability
A
0 mins
Test Coverage

Property name "$_password" should not be prefixed with an underscore to indicate visibility
Open

    protected string $_password;
Severity: Minor
Found in traits/PasswordTrait.php by phpcodesniffer

The 'getIsEmptyPassword()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getIsEmptyPassword(): bool
    {
        return
            !is_string($this->passwordHashAttribute) || empty($this->passwordHashAttribute) || $this->validatePassword($this->getEmptyPasswordSpecialty());
    }
Severity: Minor
Found in traits/PasswordTrait.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

Source https://phpmd.org/rules/naming.html#booleangetmethodname

Line exceeds 120 characters; contains 155 characters
Open

            !is_string($this->passwordHashAttribute) || empty($this->passwordHashAttribute) || $this->validatePassword($this->getEmptyPasswordSpecialty());
Severity: Minor
Found in traits/PasswordTrait.php by phpcodesniffer

There are no issues that match your filters.

Category
Status