Issues (27)

src/Config/Services.php (2 issues)

1
<?php
2
3
/**
4
 * This file is part of BlitzPHP Parametres.
5
 *
6
 * (c) 2025 Dimitri Sitchet Tomkeu <[email protected]>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
12
namespace BlitzPHP\Parametres\Config;
13
14
use BlitzPHP\Container\Services as BaseService;
15
use BlitzPHP\Parametres\Parametres;
16
17
class Services extends BaseService
18
{
19
    /**
20
     * Renvoie la classe du gestionnaire de paramètres.
21
     *
22
     * @param list<mixed>|null $config
0 ignored issues
show
The type BlitzPHP\Parametres\Config\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
     */
24
    public static function parametres(?array $config = null, bool $shared = true): Parametres
25
    {
26
        if (true === $shared && isset(static::$instances[Parametres::class])) {
27 2
            return static::$instances[Parametres::class];
28
        }
29
30 2
        return static::$instances[Parametres::class] = new Parametres($config ?? config('parametres'));
0 ignored issues
show
It seems like $config ?? config('parametres') can also be of type BlitzPHP\Config\Config and null; however, parameter $config of BlitzPHP\Parametres\Parametres::__construct() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

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

30
        return static::$instances[Parametres::class] = new Parametres(/** @scrutinizer ignore-type */ $config ?? config('parametres'));
Loading history...
31
    }
32
}
33