spiritix/lada-cache

View on GitHub
src/Spiritix/LadaCache/LadaCacheServiceProvider.php

Summary

Maintainability
A
0 mins
Test Coverage
C
73%

The class LadaCacheServiceProvider has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
Open

class LadaCacheServiceProvider extends ServiceProvider
{
    /**
     * The package configuration file.
     */

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Avoid unused parameters such as '$app'.
Open

        $this->app->bind('db.connection.sqlserver', function ($app, $parameters) {

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

Expected 1 space after FUNCTION keyword; 0 found
Open

        $this->app->singleton('command.lada-cache.flush', function() {

Expected 1 space after FUNCTION keyword; 0 found
Open

        $this->app->singleton('lada.collector', function() {

Expected 1 space after FUNCTION keyword; 0 found
Open

        $this->app->singleton('command.lada-cache.enable', function() {

Expected 1 space after FUNCTION keyword; 0 found
Open

        $this->app->singleton('lada.redis', function($app) {

Expected 1 space after FUNCTION keyword; 0 found
Open

        $this->app->singleton('lada.invalidator', function($app) {

Expected 1 space after FUNCTION keyword; 0 found
Open

        $this->app->singleton('command.lada-cache.disable', function() {

Expected 1 space after FUNCTION keyword; 0 found
Open

        $this->app->singleton('lada.cache', function($app) {

Expected 1 space after FUNCTION keyword; 0 found
Open

        $this->app->singleton('lada.handler', function($app) {

Only one argument is allowed per line in a multi-line function call
Open

            __DIR__ . '/../../../config/' . self::CONFIG_FILE, str_replace('.php', '', self::CONFIG_FILE)

There are no issues that match your filters.

Category
Status