1 | <?php |
||
7 | class Plugin_Locator { |
||
8 | |||
9 | /** |
||
10 | * The path processor for finding plugin paths. |
||
11 | * |
||
12 | * @var Path_Processor |
||
13 | */ |
||
14 | private $path_processor; |
||
15 | |||
16 | /** |
||
17 | * The constructor. |
||
18 | * |
||
19 | * @param Path_Processor $path_processor The Path_Processor instance. |
||
20 | */ |
||
21 | public function __construct( $path_processor ) { |
||
24 | |||
25 | /** |
||
26 | * Finds the path to the current plugin. |
||
27 | * |
||
28 | * @return string $path The path to the current plugin. |
||
29 | * |
||
30 | * @throws \RuntimeException If the current plugin does not have an autoloader. |
||
31 | */ |
||
32 | public function find_current_plugin() { |
||
44 | |||
45 | /** |
||
46 | * Checks a given option for plugin paths. |
||
47 | * |
||
48 | * @param string $option_name The option that we want to check for plugin information. |
||
49 | * @param bool $site_option Indicates whether or not we want to check the site option. |
||
50 | * |
||
51 | * @return array $plugin_paths The list of absolute paths we've found. |
||
52 | */ |
||
53 | public function find_using_option( $option_name, $site_option = false ) { |
||
61 | |||
62 | /** |
||
63 | * Checks for plugins in the `action` request parameter. |
||
64 | * |
||
65 | * @param string[] $allowed_actions The actions that we're allowed to return plugins for. |
||
66 | * |
||
67 | * @return array $plugin_paths The list of absolute paths we've found. |
||
68 | */ |
||
69 | public function find_using_request_action( $allowed_actions ) { |
||
112 | |||
113 | /** |
||
114 | * Given an array of plugin slugs or paths, this will convert them to absolute paths and filter |
||
115 | * out the plugins that are not directory plugins. Note that array keys will also be included |
||
116 | * if they are plugin paths! |
||
117 | * |
||
118 | * @param string[] $plugins Plugin paths or slugs to filter. |
||
119 | * |
||
120 | * @return string[] |
||
121 | */ |
||
122 | private function convert_plugins_to_paths( $plugins ) { |
||
145 | } |
||
146 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: