Replace the 'single'/'carousel' string format threaded through the AI generation path with a typed GeneratorFormat enum (PostContentGenerator, PostContentHumanizer, PostContentStreamer, StreamPostCreation, RunGenerateNode, deriveFormat). Remove generatorFormat() from AiContentTemplate and the three templates — it conflated style and format (returning 'tweet_card'). The tweet-card check now lives on ContentStyle via isTweetCard(), and the humanizer skip on ContentStyle::humanizes(), so the style declares its own behaviour instead of callers comparing magic strings.
16 lines
244 B
PHP
16 lines
244 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums\Ai;
|
|
|
|
enum GeneratorFormat: string
|
|
{
|
|
case Single = 'single';
|
|
case Carousel = 'carousel';
|
|
|
|
public function isCarousel(): bool
|
|
{
|
|
return $this === self::Carousel;
|
|
}
|
|
}
|