| 1 |
<?php |
| 2 |
|
| 3 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong |
| 4 |
namespace Yoast\WP\SEO\Editors\Application\Integrations; |
| 5 |
|
| 6 |
use Yoast\WP\SEO\Editors\Domain\Integrations\Integration_Data_Provider_Interface; |
| 7 |
|
| 8 |
/** |
| 9 |
* The repository to get all enabled integrations. |
| 10 |
* |
| 11 |
* @makePublic |
| 12 |
*/ |
| 13 |
class Integration_Information_Repository { |
| 14 |
|
| 15 |
/** |
| 16 |
* All plugin integrations. |
| 17 |
* |
| 18 |
* @var Integration_Data_Provider_Interface[] |
| 19 |
*/ |
| 20 |
private $plugin_integrations; |
| 21 |
|
| 22 |
/** |
| 23 |
* The constructor. |
| 24 |
* |
| 25 |
* @param Integration_Data_Provider_Interface ...$plugin_integrations All integrations. |
| 26 |
*/ |
| 27 |
public function __construct( Integration_Data_Provider_Interface ...$plugin_integrations ) { |
| 28 |
$this->plugin_integrations = $plugin_integrations; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Returns the analysis list. |
| 33 |
* |
| 34 |
* @return array<array<string, bool>> The parsed list. |
| 35 |
*/ |
| 36 |
public function get_integration_information(): array { |
| 37 |
$array = []; |
| 38 |
foreach ( $this->plugin_integrations as $feature ) { |
| 39 |
$array = \array_merge( $array, $feature->to_legacy_array() ); |
| 40 |
} |
| 41 |
return $array; |
| 42 |
} |
| 43 |
} |
| 44 |
|