Gush\Config::getFirstNotNull PHP Method

getFirstNotNull() public method

Returns the first none-null configuration value.
public getFirstNotNull ( array $keys, string $type = self::CONFIG_ALL, string | integer | float | boolean | array $default = null ) : string | integer | float | boolean | array
$keys array Array of single level keys like "adapters" or property-path "[adapters][github]" to check
$type string Either Config::CONFIG_SYSTEM Config::CONFIG_LOCAL or Config::CONFIG_ALL
$default string | integer | float | boolean | array Default value to use when no config is found (null)
return string | integer | float | boolean | array
    public function getFirstNotNull(array $keys, $type = self::CONFIG_ALL, $default = null)
    {
        foreach ($keys as $key) {
            $value = $this->get($key, $type);
            if (null !== $value) {
                return $value;
            }
        }
        return $default;
    }