Test Failed
Push — feature/gacela-config-callable ( f0c396 )
by Chema
04:24
created

gacela.php$0 ➔ buildConfig()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
use Gacela\Framework\AbstractConfigGacela;
6
use Gacela\Framework\Config\GacelaConfigBuilder\ConfigBuilder;
7
8
return static fn () => new class() extends AbstractConfigGacela {
0 ignored issues
show
Deprecated Code introduced by
The class Gacela\Framework\AbstractConfigGacela has been deprecated: use AbstractSetupGacela instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

8
return static fn () => new class() extends /** @scrutinizer ignore-deprecated */ AbstractConfigGacela {
Loading history...
9
    public function buildConfig(ConfigBuilder $configBuilder): void
10
    {
11
        $configBuilder->add('config/*.php', 'config/local.php');
0 ignored issues
show
Bug Best Practice introduced by
The expression ImplicitReturnNode returns the type null which is incompatible with the return type mandated by Gacela\Framework\Setup\A...upGacela::buildConfig() of Gacela\Framework\Config\...igBuilder\ConfigBuilder.

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
12
    }
13
};
14