public function tryParse( string &$pathRef, array $dynamicReplacements = [] ) : bool
   {

      $protocol = $this->getProtocol();

      if ( '' === $protocol || ! strStartsWith( $pathRef, $protocol ) )
      {
         return false;
      }

      if ( \count( $dynamicReplacements ) > 0 )
      {
         $this->addReplacements( $dynamicReplacements );
      }

      $pathRef = $this->_rootFolder . DIRECTORY_SEPARATOR . substring( $pathRef, \mb_strlen( $protocol ) );

      $pathRef = \preg_replace_callback(
         '~\$\{([A-Za-z0-9_.-]+)\}~',
         function ( $matches )
         {

            if ( ! isset( $this->_replacements[ $matches[ 1 ] ] ) )
            {
               return $matches[ 0 ];
            }

            return $this->_replacements[ $matches[ 1 ] ];
         },
         $pathRef
      );

      return true;

   }
public function tryParse( string &$pathRef, array $dynamicReplacements = [] ) : bool
   {

      $protocol = $this->getProtocol();

      if ( '' === $protocol || ! strStartsWith( $pathRef, $protocol ) )
      {
         return false;
      }

      if ( \count( $dynamicReplacements ) > 0 )
      {
         $this->addReplacements( $dynamicReplacements );
      }

      $pathRef = $this->_rootFolder . DIRECTORY_SEPARATOR . substring( $pathRef, \mb_strlen( $protocol ) );

      $pathRef = \preg_replace_callback(
         '~\$\{([A-Za-z0-9_.-]+)\}~',
         function ( $matches )
         {

            if ( ! isset( $this->_replacements[ $matches[ 1 ] ] ) )
            {
               return $matches[ 0 ];
            }

            return $this->_replacements[ $matches[ 1 ] ];
         },
         $pathRef
      );

      return true;

   }
public function tryParse ( string & $ pathRef , array $ dynamicReplacements = [ ] ) : bool { $ protocol = $ this -> getProtocol ( ) ; if ( '' === $ protocol || ! strStartsWith ( $ pathRef , $ protocol ) ) { return false ; } if ( \ count ( $ dynamicReplacements ) > 0 ) { $ this -> addReplacements ( $ dynamicReplacements ) ; } $ pathRef = $ this -> _rootFolder . DIRECTORY_SEPARATOR . substring ( $ pathRef , \ mb_strlen ( $ protocol ) ) ; $ pathRef = \ preg_replace_callback ( '~\$\{([A-Za-z0-9_.-]+)\}~' , function ( $ matches ) { if ( ! isset ( $ this -> _replacements [ $ matches [ 1 ] ] ) ) { return $ matches [ 0 ] ; } return $ this -> _replacements [ $ matches [ 1 ] ] ; } , $ pathRef ) ; return true ; }
Tries to parse a path, using a VFS protocol and replaces the protocol with a path

@param string $pathRef
@param array  $dynamicReplacements
@return bool Return TRUE on success or false otherwise.
Tries to parse a path using a VFS protocol and replaces the protocol with a path