← All changes
|
src/services/importing/importable-detector-service.php
+7
-7
18.3
→
trunk
View file →
| @@ -27,10 +27,10 @@ | ||
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Returns the detected importers that have data to work with. |
| 30 | 30 | * |
| 31 | - * @param string $plugin The plugin name of the importer. | |
| 32 | - * @param string $type The type of the importer. | |
| 31 | + * @param string|null $plugin The plugin name of the importer. | |
| 32 | + * @param string|null $type The type of the importer. | |
| 33 | 33 | * |
| 34 | 34 | * @return array The detected importers that have data to work with. |
| 35 | 35 | */ |
| 36 | 36 | public function detect_importers( $plugin = null, $type = null ) { |
| @@ -48,9 +48,9 @@ | ||
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Returns the detected cleanups that have data to work with. |
| 51 | 51 | * |
| 52 | - * @param string $plugin The plugin name of the cleanup. | |
| 52 | + * @param string|null $plugin The plugin name of the cleanup. | |
| 53 | 53 | * |
| 54 | 54 | * @return array The detected importers that have data to work with. |
| 55 | 55 | */ |
| 56 | 56 | public function detect_cleanups( $plugin = null ) { |
| @@ -69,10 +69,10 @@ | ||
| 69 | 69 | /** |
| 70 | 70 | * Filters all import actions from a list that do not match the given Plugin or Type. |
| 71 | 71 | * |
| 72 | 72 | * @param Importing_Action_Interface[] $all_actions The complete list of actions. |
| 73 | - * @param string $plugin The Plugin name whose actions to keep. | |
| 74 | - * @param string $type The type of actions to keep. | |
| 73 | + * @param string|null $plugin The Plugin name whose actions to keep. | |
| 74 | + * @param string|null $type The type of actions to keep. | |
| 75 | 75 | * |
| 76 | 76 | * @return array |
| 77 | 77 | */ |
| 78 | 78 | public function filter_actions( $all_actions, $plugin = null, $type = null ) { |
| @@ -77,10 +77,10 @@ | ||
| 77 | 77 | */ |
| 78 | 78 | public function filter_actions( $all_actions, $plugin = null, $type = null ) { |
| 79 | 79 | return \array_filter( |
| 80 | 80 | $all_actions, |
| 81 | - function( $action ) use ( $plugin, $type ) { | |
| 81 | + static function ( $action ) use ( $plugin, $type ) { | |
| 82 | 82 | return $action->is_compatible_with( $plugin, $type ); |
| 83 | - } | |
| 83 | + }, | |
| 84 | 84 | ); |
| 85 | 85 | } |
| 86 | 86 | } |