: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Yoast\WP\SEO\Introductions\Domain;
* A collection domain object.
class Introductions_Bucket {
* Holds the introductions.
* @var Introduction_Item[]
public function __construct() {
$this->introductions = [];
* Adds an introduction to this bucket.
* @param Introduction_Item $introduction The introduction.
public function add_introduction( Introduction_Item $introduction ) {
$this->introductions[] = $introduction;
* Returns the array representation of the introductions.
public function to_array() {
// No sorting here because that is done in JS.
static function ( $item ) {
return $item->to_array();