detain/myadmin-plugin-installer

View on GitHub
src/Loader.php

Summary

Maintainability
A
35 mins
Test Coverage

Method add_route_requirement has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function add_route_requirement($type, $function, $source = '', $path = false, $methods = false)
Severity: Minor
Found in src/Loader.php - About 35 mins to fix

    The property $admin_routes is not named in camelCase.
    Open

    class Loader
    {
        protected $requirements;
        protected $routes;
        protected $admin_routes;
    Severity: Minor
    Found in src/Loader.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 $public_routes is not named in camelCase.
    Open

    class Loader
    {
        protected $requirements;
        protected $routes;
        protected $admin_routes;
    Severity: Minor
    Found in src/Loader.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 add_api_page_requirement is not named in camelCase.
    Open

        public function add_api_page_requirement($function, $source, $methods = false)
        {
            $this->add_route_requirement('client_api', $function, $source, '/apiv2/'.$function, $methods);
            $this->add_route_requirement('client_api', $function, $source, '/admin/apiv2/'.$function, $methods);
        }
    Severity: Minor
    Found in src/Loader.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

    The method add_admin_page_requirement is not named in camelCase.
    Open

        public function add_admin_page_requirement($function, $source, $methods = false)
        {
            $this->add_route_requirement('admin', $function, $source, '/admin/'.$function, $methods);
        }
    Severity: Minor
    Found in src/Loader.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

    The method add_route_requirement is not named in camelCase.
    Open

        public function add_route_requirement($type, $function, $source = '', $path = false, $methods = false)
        {
            if ($path === false) {
                $path = '/'.$function;
            }
    Severity: Minor
    Found in src/Loader.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

    The method add_page_requirement is not named in camelCase.
    Open

        public function add_page_requirement($function, $source, $methods = false)
        {
            $this->add_route_requirement('client', $function, $source, '/'.$function, $methods);
            $this->add_route_requirement('client', $function, $source, '/admin/'.$function, $methods);
        }
    Severity: Minor
    Found in src/Loader.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

    The method add_public_requirement is not named in camelCase.
    Open

        public function add_public_requirement($function, $source, $methods = false)
        {
            $this->add_route_requirement('public', $function, $source, '/'.$function, $methods);
        }
    Severity: Minor
    Found in src/Loader.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

    The method add_public_file is not named in camelCase.
    Open

        public function add_public_file($function, $source, $methods = false)
        {
            $this->add_route_requirement('public_file', $function, $source, '', '/'.$function, $methods);
        }
    Severity: Minor
    Found in src/Loader.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

    The method get_setting is not named in camelCase.
    Open

        public function get_setting($setting)
        {
            return constant($setting);
        }
    Severity: Minor
    Found in src/Loader.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

    The method add_root_page_requirement is not named in camelCase.
    Open

        public function add_root_page_requirement($function, $source, $methods = false)
        {
            $this->add_route_requirement('client', $function, $source, '/'.$function, $methods);
        }
    Severity: Minor
    Found in src/Loader.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

    The method add_ajax_page_requirement is not named in camelCase.
    Open

        public function add_ajax_page_requirement($function, $source, $methods = false)
        {
            $this->add_route_requirement('client_ajax', $function, $source, '/ajax/'.$function, $methods);
            $this->add_route_requirement('client_ajax', $function, $source, '/admin/ajax/'.$function, $methods);
        }
    Severity: Minor
    Found in src/Loader.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

    The method add_apmin_api_page_requirement is not named in camelCase.
    Open

        public function add_apmin_api_page_requirement($function, $source, $methods = false)
        {
            $this->add_route_requirement('admin_api', $function, $source, '/admin/ajax/'.$function, $methods);
        }
    Severity: Minor
    Found in src/Loader.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

    The method add_requirement is not named in camelCase.
    Open

        public function add_requirement($function, $source, $methods = false)
        {
            if ($source != '') {
                $this->requirements[$function] = $source;
            }
    Severity: Minor
    Found in src/Loader.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

    The method get_requirements is not named in camelCase.
    Open

        public function get_requirements()
        {
            return $this->requirements;
        }
    Severity: Minor
    Found in src/Loader.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

    The method get_routes is not named in camelCase.
    Open

        public function get_routes()
        {
            $routes = $this->routes;
            uksort($routes, function ($a, $b) {
                if (strlen($a) == strlen($b)) {
    Severity: Minor
    Found in src/Loader.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