1 | <?php |
||
23 | class SiteAliasFileDiscovery |
||
24 | { |
||
25 | protected $searchLocations; |
||
26 | protected $locationFilter; |
||
27 | protected $depth; |
||
28 | |||
29 | public function __construct($searchLocations = [], $depth = '<= 1', $locationFilter = null) |
||
35 | |||
36 | /** |
||
37 | * Add a location that alias files may be found. |
||
38 | * |
||
39 | * @param string $path |
||
|
|||
40 | * @return $this |
||
41 | */ |
||
42 | public function addSearchLocation($paths) |
||
51 | |||
52 | /** |
||
53 | * Return all of the paths where alias files may be found. |
||
54 | * @return string[] |
||
55 | */ |
||
56 | public function searchLocations() |
||
60 | |||
61 | public function locationFilter() |
||
65 | |||
66 | /** |
||
67 | * Set the search depth for finding alias files |
||
68 | * |
||
69 | * @param string|int $depth (@see \Symfony\Component\Finder\Finder::depth) |
||
70 | * @return $this |
||
71 | */ |
||
72 | public function depth($depth) |
||
77 | |||
78 | /** |
||
79 | * Only search for aliases that are in alias files stored in directories |
||
80 | * whose basename or key matches the specified location. |
||
81 | */ |
||
82 | public function filterByLocation($location) |
||
90 | |||
91 | /** |
||
92 | * Find an alias file SITENAME.site.yml in one |
||
93 | * of the specified search locations. |
||
94 | * |
||
95 | * @param string $siteName |
||
96 | * @return string[] |
||
97 | */ |
||
98 | public function find($siteName) |
||
102 | |||
103 | /** |
||
104 | * Find an alias file SITENAME.site.yml in one |
||
105 | * of the specified search locations. |
||
106 | * |
||
107 | * @param string $siteName |
||
108 | * @return string|bool |
||
109 | */ |
||
110 | public function findSingleSiteAliasFile($siteName) |
||
118 | |||
119 | /** |
||
120 | * Return a list of all SITENAME.site.yml files in any of |
||
121 | * the search locations. |
||
122 | * |
||
123 | * @return string[] |
||
124 | */ |
||
125 | public function findAllSingleAliasFiles() |
||
129 | |||
130 | /** |
||
131 | * Return all of the legacy alias files used in previous Drush versions. |
||
132 | * |
||
133 | * @return string[] |
||
134 | */ |
||
135 | public function findAllLegacyAliasFiles() |
||
143 | |||
144 | /** |
||
145 | * Create a Symfony Finder object to search all available search locations |
||
146 | * for the specified search pattern. |
||
147 | * |
||
148 | * @param string $searchPattern |
||
149 | * @return Finder |
||
150 | */ |
||
151 | protected function createFinder($searchPattern) |
||
160 | |||
161 | /** |
||
162 | * Return a list of all alias files matching the provided pattern. |
||
163 | * |
||
164 | * @param string $searchPattern |
||
165 | * @return string[] |
||
166 | */ |
||
167 | protected function searchForAliasFiles($searchPattern) |
||
194 | |||
195 | /** |
||
196 | * splitLocationFromSite returns the part of 'site' before the first |
||
197 | * '.' as the "path match" component, and the part after the first |
||
198 | * '.' as the "site" component. |
||
199 | */ |
||
200 | protected function splitLocationFromSite($site) |
||
206 | |||
207 | |||
208 | // TODO: Seems like this could just be basename() |
||
209 | protected function extractKey($basename, $filenameExensions) |
||
213 | } |
||
214 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.