Change snip content text rebuilding to static, allowing a lot cleaner interface getting the lastest text

This commit is contained in:
Tim
2025-05-13 12:33:25 +02:00
parent 04b2037f2d
commit 62136a0ca0
7 changed files with 25 additions and 29 deletions

View File

@ -13,9 +13,7 @@ use Symfony\Component\Routing\Attribute\Route;
#[Route('/content', name: 'content')]
class SnipContentController extends AbstractController
{
public function __construct(
private readonly SnipContentService $contentService,
) {}
public function __construct() {}
#[Route('/compare/{to}/{from}', name: '_compare')]
public function compare(SnipContent $to, ?SnipContent $from = null): Response
@ -27,8 +25,8 @@ class SnipContentController extends AbstractController
}
$diff = MyersDiff::buildDiffLines(
$this->contentService->rebuildText($from),
$this->contentService->rebuildText($to),
SnipContentService::rebuildText($from),
SnipContentService::rebuildText($to),
);
return $this->render('content/compare.html.twig', [