public static function createFromSource($source, $type, array $options = []) {
		if (isset(self::$readers[$type])) {
			$reader = self::$readers[$type];
		} else {
			$class  = self::READERS_NAMESPACE . '\\' . ucfirst($type);
			$reader = new $class();

			if (! $reader instanceof ReaderInterface) {
				throw new InvalidReader('Reader must implement the "ReaderInterface"');
			}
			
			self::$readers[$type] = $reader;
		}
		
		// Read only lock resolve
		if (isset($options[self::OPTION_READONLY])) {
			$readOnly = (bool) $options[self::OPTION_READONLY];
			unset($options[self::OPTION_READONLY]);
		} else {
			$readOnly = true;
		}
		
		return self::create($reader->parse($source, $options), $readOnly);
	}
public static function createFromSource($source, $type, array $options = []) {
		if (isset(self::$readers[$type])) {
			$reader = self::$readers[$type];
		} else {
			$class  = self::READERS_NAMESPACE . '\\' . ucfirst($type);
			$reader = new $class();

			if (! $reader instanceof ReaderInterface) {
				throw new InvalidReader('Reader must implement the "ReaderInterface"');
			}
			
			self::$readers[$type] = $reader;
		}
		
		// Read only lock resolve
		if (isset($options[self::OPTION_READONLY])) {
			$readOnly = (bool) $options[self::OPTION_READONLY];
			unset($options[self::OPTION_READONLY]);
		} else {
			$readOnly = true;
		}
		
		return self::create($reader->parse($source, $options), $readOnly);
	}
public static function createFromSource ( $ source , $ type , array $ options = [ ] ) { if ( isset ( self :: $ readers [ $ type ] ) ) { $ reader = self :: $ readers [ $ type ] ; } else { $ class = self :: READERS_NAMESPACE . '\\' . ucfirst ( $ type ) ; $ reader = new $ class ( ) ; if ( ! $ reader instanceof ReaderInterface ) { throw new InvalidReader ( 'Reader must implement the "ReaderInterface"' ) ; } self :: $ readers [ $ type ] = $ reader ; } // Read only lock resolve if ( isset ( $ options [ self :: OPTION_READONLY ] ) ) { $ readOnly = ( bool ) $ options [ self :: OPTION_READONLY ] ; unset ( $ options [ self :: OPTION_READONLY ] ) ; } else { $ readOnly = true ; } return self :: create ( $ reader -> parse ( $ source , $ options ) , $ readOnly ) ; }
Create a config from the source

@param string $source   Source of a config
@param string $type     Type of a config
@param bool   $readOnly Created config must be locked to a read only
@param array  $options  Options for a reader

@return ConfigInterface
Create a config from the source