This repository was archived by the owner on Jul 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathAbsolutePathInterface.php
More file actions
66 lines (59 loc) · 1.89 KB
/
AbsolutePathInterface.php
File metadata and controls
66 lines (59 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
* This file is part of the Pathogen package.
*
* Copyright © 2014 Erin Millard
*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/
namespace Eloquent\Pathogen;
/**
* The interface implemented by absolute paths.
*/
interface AbsolutePathInterface extends PathInterface
{
/**
* Determine whether this path is the root path.
*
* The root path is an absolute path with no atoms.
*
* @return boolean True if this path is the root path.
*/
public function isRoot();
/**
* Determine if this path is the direct parent of the supplied path.
*
* @param AbsolutePathInterface $path The child path.
*
* @return boolean True if this path is the direct parent of the supplied path.
*/
public function isParentOf(AbsolutePathInterface $path);
/**
* Determine if this path is an ancestor of the supplied path.
*
* @param AbsolutePathInterface $path The child path.
*
* @return boolean True if this path is an ancestor of the supplied path.
*/
public function isAncestorOf(AbsolutePathInterface $path);
/**
* Determine the shortest path from the supplied path to this path.
*
* For example, given path A equal to '/foo/bar', and path B equal to
* '/foo/baz', A relative to B would be '../bar'.
*
* @param AbsolutePathInterface $path The path that the generated path will be relative to.
*
* @return RelativePathInterface A relative path from the supplied path to this path.
*/
public function relativeTo(AbsolutePathInterface $path);
/**
* Resolve the supplied path against this path.
*
* @param PathInterface $path The path to resolve.
*
* @return AbsolutePathInterface The resolved path.
*/
public function resolve(PathInterface $path);
}