public function load(string $path, string $key = null): ConfigInterface
    {
        try {
            // Read parameters from file
            $parameters = $this->loadFile($path);

            // If key is provided then need put parameters into subarray
            if (null !== $key) {
                $parameters = [$key => $parameters];
            }

            // Keep configuration
            $this->setter($parameters);

        } catch (Exception $e) {
            // Error message implemented in exception
        }
        return $this;
    }
public function load(string $path, string $key = null): ConfigInterface
    {
        try {
            // Read parameters from file
            $parameters = $this->loadFile($path);

            // If key is provided then need put parameters into subarray
            if (null !== $key) {
                $parameters = [$key => $parameters];
            }

            // Keep configuration
            $this->setter($parameters);

        } catch (Exception $e) {
            // Error message implemented in exception
        }
        return $this;
    }
public function load ( string $ path , string $ key = null ) : ConfigInterface { try { // Read parameters from file $ parameters = $ this -> loadFile ( $ path ) ; // If key is provided then need put parameters into subarray if ( null !== $ key ) { $ parameters = [ $ key => $ parameters ] ; } // Keep configuration $ this -> setter ( $ parameters ) ; } catch ( Exception $ e ) { // Error message implemented in exception } return $ this ; }
Load configuration file, show config path if needed

@param   string $path path to file with array
@param   string $key in which subkey this file must be saved
@return  ConfigInterface
Load configuration file show config path if needed