PHP 8.2.31
Preview: suggestions-bucket.php Size: 911 B
/home/nshryvcy/blissfulnepal.com/wp-content/plugins/wordpress-seo/src/ai/generator/domain/suggestions-bucket.php

<?php

// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.

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,
		);
	}
}

Directory Contents

Dirs: 0 × Files: 3

Name Size Perms Modified Actions
617 B lrw-r--r-- 2026-06-03 14:57:42
Edit Download
911 B lrw-r--r-- 2026-06-03 14:57:42
Edit Download
795 B lrw-r--r-- 2026-06-03 14:57:42
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).