1 | <?php |
||
12 | trait SiteAliasTrait |
||
13 | { |
||
14 | /** |
||
15 | * @inheritdoc |
||
16 | */ |
||
17 | public function hasRoot() |
||
21 | |||
22 | /** |
||
23 | * @inheritdoc |
||
24 | * |
||
25 | * @throws \Exception when the alias does not specify a root. |
||
26 | */ |
||
27 | public function root() |
||
38 | |||
39 | /** |
||
40 | * @inheritdoc |
||
41 | */ |
||
42 | public function uri() |
||
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | */ |
||
50 | public function setUri($uri) |
||
54 | |||
55 | /** |
||
56 | * @inheritdoc |
||
57 | */ |
||
58 | public function remoteHostWithUser() |
||
66 | |||
67 | /** |
||
68 | * @inheritdoc |
||
69 | */ |
||
70 | public function remoteUser() |
||
74 | |||
75 | /** |
||
76 | * @inheritdoc |
||
77 | */ |
||
78 | public function hasRemoteUser() |
||
82 | |||
83 | /** |
||
84 | * @inheritdoc |
||
85 | */ |
||
86 | public function remoteHost() |
||
90 | |||
91 | /** |
||
92 | * @inheritdoc |
||
93 | */ |
||
94 | public function isRemote() |
||
98 | |||
99 | /** |
||
100 | * @inheritdoc |
||
101 | */ |
||
102 | public function isLocal() |
||
106 | |||
107 | /** |
||
108 | * @inheritdoc |
||
109 | */ |
||
110 | public function isContainer() |
||
114 | |||
115 | /** |
||
116 | * @inheritdoc |
||
117 | */ |
||
118 | public function isNone() |
||
122 | |||
123 | /** |
||
124 | * @inheritdoc |
||
125 | */ |
||
126 | public function localRoot() |
||
134 | |||
135 | /** |
||
136 | * os returns the OS that this alias record points to. For local alias |
||
137 | * records, PHP_OS will be returned. For remote alias records, the |
||
138 | * value from the `os` element will be returned. If there is no `os` |
||
139 | * element, then the default assumption is that the remote system is Linux. |
||
140 | * |
||
141 | * @return string |
||
142 | * Linux |
||
143 | * WIN* (e.g. WINNT) |
||
144 | * CYGWIN |
||
145 | * MINGW* (e.g. MINGW32) |
||
146 | */ |
||
147 | public function os() |
||
154 | } |
||
155 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.