Formula9/Framework

View on GitHub
F9/Console/ConsoleFactory.php

Summary

Maintainability
A
1 hr
Test Coverage

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

    private function registerInstances($config, $app, $events, $container, $global_scope)
Severity: Minor
Found in F9/Console/ConsoleFactory.php - About 35 mins to fix

    Avoid too many return statements within this method.
    Open

            return [$global_scope, $config, $events];
    Severity: Major
    Found in F9/Console/ConsoleFactory.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              $container->add('config', function () use ($container) { return $container['Config']; });
      Severity: Major
      Found in F9/Console/ConsoleFactory.php - About 30 mins to fix

        Avoid unused private methods such as 'makeConsole'.
        Open

            private function makeConsole(array $paths) : Console
            {
                // register and collection common class objects
                list($global_scope, $config, $events) = $this->registerClasses($paths, static::$container);
        
        
        Severity: Minor
        Found in F9/Console/ConsoleFactory.php by phpmd

        UnusedPrivateMethod

        Since: 0.2

        Unused Private Method detects when a private method is declared but is unused.

        Example

        class Something
        {
            private function foo() {} // unused
        }

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

        The parameter $global_scope is not named in camelCase.
        Open

            private function registerInstances($config, $app, $events, $container, $global_scope)
            {
                $app['config'] = $config;
                $app['nine.events'] = $events;
                $app['illuminate.container'] = $container;
        Severity: Minor
        Found in F9/Console/ConsoleFactory.php by phpmd

        CamelCaseParameterName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething($user_name) {
            }
        }

        Source

        The variable $global_scope is not named in camelCase.
        Open

            private function registerInstances($config, $app, $events, $container, $global_scope)
            {
                $app['config'] = $config;
                $app['nine.events'] = $events;
                $app['illuminate.container'] = $container;
        Severity: Minor
        Found in F9/Console/ConsoleFactory.php by phpmd

        CamelCaseVariableName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $global_scope is not named in camelCase.
        Open

            private function registerClasses(array $paths, $container)
            {
                // we'll start by loading the configuration into the Forge Container
                $container->add(ContainerInterface::class, function () { return Forge::getInstance(); });
                $container->add([Scope::class, 'context'], function () { return new Scope; });
        Severity: Minor
        Found in F9/Console/ConsoleFactory.php by phpmd

        CamelCaseVariableName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $global_scope is not named in camelCase.
        Open

            private function makeConsole(array $paths) : Console
            {
                // register and collection common class objects
                list($global_scope, $config, $events) = $this->registerClasses($paths, static::$container);
        
        
        Severity: Minor
        Found in F9/Console/ConsoleFactory.php by phpmd

        CamelCaseVariableName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $global_scope is not named in camelCase.
        Open

            private function registerClasses(array $paths, $container)
            {
                // we'll start by loading the configuration into the Forge Container
                $container->add(ContainerInterface::class, function () { return Forge::getInstance(); });
                $container->add([Scope::class, 'context'], function () { return new Scope; });
        Severity: Minor
        Found in F9/Console/ConsoleFactory.php by phpmd

        CamelCaseVariableName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $global_scope is not named in camelCase.
        Open

            private function makeConsole(array $paths) : Console
            {
                // register and collection common class objects
                list($global_scope, $config, $events) = $this->registerClasses($paths, static::$container);
        
        
        Severity: Minor
        Found in F9/Console/ConsoleFactory.php by phpmd

        CamelCaseVariableName

        Since: 0.2

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

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        There are no issues that match your filters.

        Category
        Status