Issues (61)

Framework/Helpers/ConfigLibraryHelper.php (1 issue)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace WebServCo\Framework\Helpers;
6
7
use WebServCo\Framework\Libraries\Config;
8
9
final class ConfigLibraryHelper extends AbstractLibraryHelper
10
{
11
    private static ?Config $object = null;
12
13
    /**
14
    * @return array<mixed>
15
    */
16
    public static function getSettings(string $name): array
17
    {
18
        return self::library()->load($name, \WebServCo\Framework\Environment\Config::string('APP_PATH_PROJECT'));
19
    }
20
21
    public static function library(): Config
22
    {
23
        if (!self::$object instanceof Config) {
24
            self::$object = new Config();
25
        }
26
        return self::$object;
0 ignored issues
show
Bug Best Practice introduced by
The expression return self::object could return the type null which is incompatible with the type-hinted return WebServCo\Framework\Libraries\Config. Consider adding an additional type-check to rule them out.
Loading history...
27
    }
28
}
29