1 | <?php |
||
10 | trait ChecksSite |
||
11 | { |
||
12 | use ItFetchesSites; |
||
13 | |||
14 | /** |
||
15 | * Check site. |
||
16 | * |
||
17 | * @return bool |
||
18 | */ |
||
19 | protected function checkSite() |
||
20 | { |
||
21 | $sites = $this->fetchSites(fp_env('ACACHA_FORGE_SERVER')); |
||
22 | return in_array(fp_env('ACACHA_FORGE_SITE'), collect($sites)->pluck('id')->toArray()); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Check site and abort. |
||
27 | * |
||
28 | * @param null $site |
||
29 | */ |
||
30 | protected function checkSiteAndAbort($site = null) |
||
38 | } |
||
39 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.