Example #1
0
 /**
  * Resolve a path against a given base path.
  *
  * @param AbsolutePathInterface $basePath The base path.
  * @param PathInterface         $path     The path to resolve.
  *
  * @return AbsolutePathInterface The resolved path.
  */
 public function resolve(AbsolutePathInterface $basePath, PathInterface $path)
 {
     if ($path instanceof AbsolutePathInterface) {
         return $path;
     }
     return $basePath->join($path);
 }
 /**
  * Resolve a path against a given base path.
  *
  * @param AbsolutePathInterface $basePath The base path.
  * @param PathInterface         $path     The path to resolve.
  *
  * @return AbsolutePathInterface The resolved path.
  */
 public function resolve(AbsolutePathInterface $basePath, PathInterface $path)
 {
     if ($path instanceof AbsolutePathInterface) {
         return $path;
     }
     if ($path instanceof RelativeWindowsPathInterface) {
         if ($path->isAnchored()) {
             return $path->joinDrive($basePath->drive());
         }
         if ($path->hasDrive() && !$path->matchesDrive($basePath->drive())) {
             return $path->toAbsolute();
         }
     }
     return $basePath->join($path);
 }