fix: improve naming of Scout ResultProcessors with Host + Prop taxonomy

This commit is contained in:
2026-02-06 12:57:18 +01:00
parent 0357b15ff8
commit 798e98a701
3 changed files with 7 additions and 5 deletions
@@ -5,7 +5,7 @@ namespace App\Service\Scout;
/**
* Transforms a Vimeo thumbnail URI into an HD URI for a cover.
*/
class CoverVimeoProcessor implements ScoutProcessorInterface
class VimeoCoverProcessor implements ScoutProcessorInterface
{
public function supports(ScoutResult $result): bool
{
@@ -5,11 +5,11 @@ namespace App\Service\Scout;
/**
* Tries to fix bad YouTube responses caused by malformed URI host.
*/
class UnresponsiveYoutubeProcessor implements ScoutProcessorInterface
class YoutubeBadhostProcessor implements ScoutProcessorInterface
{
public function supports(ScoutResult $result): bool
{
return $result->image === null && \in_array($result->getUri()->getHost(), [
return $result->title === null && \in_array($result->getUri()->getHost(), [
'youtube.com',
]);
}
@@ -17,7 +17,9 @@ class UnresponsiveYoutubeProcessor implements ScoutProcessorInterface
public function process(ScoutResult $result): ScoutResult
{
$uri = $result->getUri();
$result->retry = $uri->withHost(\sprintf('www.%s', $uri->getHost()));
$wwwHost = \sprintf('www.%s', $uri->getHost());
$result->retry = $uri->withHost($wwwHost);
return $result;
}
@@ -5,7 +5,7 @@ namespace App\Service\Scout;
/**
* Transforms a YouTube thumbnail URI into a high-res URI for a cover.
*/
class CoverYoutubeProcessor implements ScoutProcessorInterface
class YoutubeCoverProcessor implements ScoutProcessorInterface
{
public function supports(ScoutResult $result): bool
{