lib/Ajde/Cms.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class 'NodeModel' in method 'detectNodeSlug'.
Open

        $node = NodeModel::fromSlug($slug);
Severity: Minor
Found in lib/Ajde/Cms.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 'Ajde_Event' in method '__bootstrap'.
Open

        Ajde_Event::register('Ajde_Core_Route', 'onAfterLangSet', [$this, 'setHomepage']);
Severity: Minor
Found in lib/Ajde/Cms.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 'Ajde_Event' in method '__bootstrap'.
Open

        Ajde_Event::register('Ajde_Core_Route', 'onAfterRouteSet', [$this, 'detectShopSlug']);
Severity: Minor
Found in lib/Ajde/Cms.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 'NodeModel' in method 'setHomepage'.
Open

            $node = NodeModel::fromPk($homepageNodeId);
Severity: Minor
Found in lib/Ajde/Cms.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 'Config' in method 'detectNodeSlug'.
Open

            Config::set('routes.list', $routes);
Severity: Minor
Found in lib/Ajde/Cms.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 'ProductModel' in method 'detectShopSlug'.
Open

            $product = ProductModel::fromSlug($lastSlugPart);
Severity: Minor
Found in lib/Ajde/Cms.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 'Config' in method 'setHomepage'.
Open

                Config::set('routes.homepage', $node->getUrl());
Severity: Minor
Found in lib/Ajde/Cms.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 'Config' in method 'detectShopSlug'.
Open

                Config::set('routes.list', $routes);
Severity: Minor
Found in lib/Ajde/Cms.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 'SettingModel' in method 'setHomepage'.
Open

        $homepageNodeId = (int) SettingModel::byName('homepage');
Severity: Minor
Found in lib/Ajde/Cms.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 'Ajde_Event' in method '__bootstrap'.
Open

        Ajde_Event::register('Ajde_Core_Route', 'onAfterRouteSet', [$this, 'detectNodeSlug']);
Severity: Minor
Found in lib/Ajde/Cms.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 unused parameters such as '$route'.
Open

    public function setHomepage(Ajde_Core_Route $route)
Severity: Minor
Found in lib/Ajde/Cms.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

The class Ajde_Cms is not named in CamelCase.
Open

class Ajde_Cms extends Ajde_Object_Singleton implements Ajde_BootstrapInterface
{
    private $_homepageSet = false;

    /**
Severity: Minor
Found in lib/Ajde/Cms.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The property $_homepageSet is not named in camelCase.
Open

class Ajde_Cms extends Ajde_Object_Singleton implements Ajde_BootstrapInterface
{
    private $_homepageSet = false;

    /**
Severity: Minor
Found in lib/Ajde/Cms.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 $_detectedNode is not named in camelCase.
Open

class Ajde_Cms extends Ajde_Object_Singleton implements Ajde_BootstrapInterface
{
    private $_homepageSet = false;

    /**
Severity: Minor
Found in lib/Ajde/Cms.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 method __bootstrap is not named in camelCase.
Open

    public function __bootstrap()
    {
        Ajde_Event::register('Ajde_Core_Route', 'onAfterLangSet', [$this, 'setHomepage']);
        Ajde_Event::register('Ajde_Core_Route', 'onAfterRouteSet', [$this, 'detectNodeSlug']);
        Ajde_Event::register('Ajde_Core_Route', 'onAfterRouteSet', [$this, 'detectShopSlug']);
Severity: Minor
Found in lib/Ajde/Cms.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status