| Server IP : 45.77.68.45 / Your IP : 127.0.0.100 Web Server : PHPix/0.2.2 (Caddy compatible) System : wasi wasmer.sh 0.0.0 0.0.0 wasm32 User : ( 1) PHP Version : 8.3.21 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /app/wp-content/plugins/wordpress-seo/src/ai-generator/domain/ |
Upload File : |
<?php
namespace Yoast\WP\SEO\AI_Generator\Domain;
/**
* Class Suggestion_Bucket
* Represents a collection of Suggestion objects.
*/
class Suggestions_Bucket {
/**
* The suggestions.
*
* @var array<Suggestion>
*/
private $suggestions;
/**
* Class constructor.
*/
public function __construct() {
$this->suggestions = [];
}
/**
* Adds a suggestion to the bucket.
*
* @param Suggestion $suggestion The suggestion to add.
*
* @return void
*/
public function add_suggestion( Suggestion $suggestion ) {
$this->suggestions[] = $suggestion;
}
/**
* Returns the suggestions as an array.
*
* @return array<string>
*/
public function to_array() {
return \array_map(
static function ( $item ) {
return $item->get_value();
},
$this->suggestions
);
}
}