<?php
/**
 * Name: Blockquote
 * Description: Blockquotes for AUX
 * Alias: quote
 *
 * Example usage:
 * This shortcode can be referenced with the name "blockquote" or "quote".
 *
 * ```
 * [blockquote name="Name" title="Title" organization="Organization" long="true"]
 * This is a blockquote.
 * [/blockquote]
 * ```
 * or, like this:
 * ```
 * [quote name="Name" title="Title" organization="Organization" long="true"]
 * This is a blockquote.
 * [/quote]
 * ```
 *
 * @var string $content Text content of the quote
 * @var array{
 *   name: string|null,
 *   title: string|null,
 *   organization: string|null,
 *   long: string|int|bool|null
 * } $attributes
 */

declare(strict_types=1);

use WP_AUX\Entities\AuxFramework\Partials\QuoteEntity;

$blockquote = QuoteEntity::createBlockquote($content)
  ->setCitation($attributes);

if (isset($attributes['long'])) {
  $blockquote->setIsLong($attributes['long']);
}

echo $blockquote;
