rhosocial/yii2-organization

View on GitHub
forms/SetUpForm.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\Yii' in method 'attributeLabels'.
Open

            'nickname' => Yii::t('user', 'Nickname'),
Severity: Minor
Found in forms/SetUpForm.php by phpmd

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 'attributeLabels'.
Open

            'timezone' => Yii::t('user', 'Timezone'),
Severity: Minor
Found in forms/SetUpForm.php by phpmd

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 'attributeLabels'.
Open

            'description' => Yii::t('organization', 'Description'),
Severity: Minor
Found in forms/SetUpForm.php by phpmd

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 'attributeLabels'.
Open

            'name' => Yii::t('organization', 'Name'),
Severity: Minor
Found in forms/SetUpForm.php by phpmd

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 'attributeLabels'.
Open

            'gravatar_type' => Yii::t('user', 'Gravatar Type'),
Severity: Minor
Found in forms/SetUpForm.php by phpmd

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 'attributeLabels'.
Open

            'gravatar' => Yii::t('user', 'Gravatar'),
Severity: Minor
Found in forms/SetUpForm.php by phpmd

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 $_parent is not named in camelCase.
Open

class SetUpForm extends Model
{
    public $name;
    public $nickname = '';
    public $gravatar_type = 0;
Severity: Minor
Found in forms/SetUpForm.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $_user is not named in camelCase.
Open

class SetUpForm extends Model
{
    public $name;
    public $nickname = '';
    public $gravatar_type = 0;
Severity: Minor
Found in forms/SetUpForm.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $gravatar_type is not named in camelCase.
Open

class SetUpForm extends Model
{
    public $name;
    public $nickname = '';
    public $gravatar_type = 0;
Severity: Minor
Found in forms/SetUpForm.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

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

    private $_parent;
Severity: Minor
Found in forms/SetUpForm.php by phpcodesniffer

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

    private $_user;
Severity: Minor
Found in forms/SetUpForm.php by phpcodesniffer

Line exceeds 120 characters; contains 175 characters
Open

        return $this->getUser()->setUpDepartment($this->name, $this->getParent(), $this->nickname, $this->gravatar_type, $this->gravatar, $this->timezone, $this->description);
Severity: Minor
Found in forms/SetUpForm.php by phpcodesniffer

Line exceeds 120 characters; contains 157 characters
Open

        return $this->getUser()->setUpOrganization($this->name, $this->nickname, $this->gravatar_type, $this->gravatar, $this->timezone, $this->description);
Severity: Minor
Found in forms/SetUpForm.php by phpcodesniffer

Whitespace found at end of line
Open

     * @var Organization 
Severity: Minor
Found in forms/SetUpForm.php by phpcodesniffer

Expected 1 space after IF keyword; 0 found
Open

        if(!isset($this->timezone)) {
Severity: Minor
Found in forms/SetUpForm.php by phpcodesniffer

Whitespace found at end of line
Open

     * @var User 
Severity: Minor
Found in forms/SetUpForm.php by phpcodesniffer

There are no issues that match your filters.

Category
Status