public function load($file, array $options = []): Config
    {
        expect_type($file, 'string');

        $options += $this->options;
        $path = $this->absolutePath($file, $options['base_path'] ?? getcwd());

        if (!$this->assertFile($path, $options)) {
            return new Config();
        }

        $data = $this->loadFile($path, $options);
        $this->assertData($data, $file);

        return new Config($data);
    }
public function load($file, array $options = []): Config
    {
        expect_type($file, 'string');

        $options += $this->options;
        $path = $this->absolutePath($file, $options['base_path'] ?? getcwd());

        if (!$this->assertFile($path, $options)) {
            return new Config();
        }

        $data = $this->loadFile($path, $options);
        $this->assertData($data, $file);

        return new Config($data);
    }
public function load ( $ file , array $ options = [ ] ) : Config { expect_type ( $ file , 'string' ) ; $ options += $ this -> options ; $ path = $ this -> absolutePath ( $ file , $ options [ 'base_path' ] ?? getcwd ( ) ) ; if ( ! $ this -> assertFile ( $ path , $ options ) ) { return new Config ( ) ; } $ data = $ this -> loadFile ( $ path , $ options ) ; $ this -> assertData ( $ data , $ file ) ; return new Config ( $ data ) ; }
Load a config file or directory

@param string $file`
@param array  $options
@return Config
Load a config file or directory