Yoast\WP\SEO\AI_Generator\Domain

Suggestions_Bucket{} │ Yoast 1.0

Устарела с версии 28.4. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Class Suggestion_Bucket Represents a collection of Suggestion objects.

Хуков нет.

Использование

$Suggestions_Bucket = new Suggestions_Bucket();
// use class methods

Методы

  1. public __construct()
  2. public add_suggestion( Suggestion $suggestion )
  3. public to_array()
  4. public _deprecated_function( __METHOD__, 'Yoast SEO 28.4' )
  5. ERROR: no method name found on line `*`
  6. ERROR: no method name found on line `*`

Список изменений

Устарела с 28.4

Код Suggestions_Bucket{} Yoast 28.9

class Suggestions_Bucket {

	/**
	 * The suggestions.
	 *
	 * @var array<Suggestion>
	 */
	private $suggestions;

	/**
	 * Class constructor.
	 *
	 * @deprecated 28.4
	 * @codeCoverageIgnore
	 */
	public function __construct() {
		\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
		$this->suggestions = [];
	}

	/**
	 * Adds a suggestion to the bucket.
	 *
	 * @deprecated 28.4
	 * @codeCoverageIgnore
	 *
	 * @param Suggestion $suggestion The suggestion to add.
	 *
	 * @return void
	 */
	public function add_suggestion( Suggestion $suggestion ) {
		\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
		$this->suggestions[] = $suggestion;
	}

	/**
	 * Returns the suggestions as an array.
	 *
	 * @deprecated 28.4
	 * @codeCoverageIgnore
	 *
	 * @return array<string>
	 */
	public function to_array() {
		\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
		return \array_map(
			static function ( $item ) {
				return $item->get_value();
			},
			$this->suggestions,
		);
	}
}