diff --git a/src/Form/PostType.php b/src/Form/PostType.php index e0501ae03..91b27dafb 100644 --- a/src/Form/PostType.php +++ b/src/Form/PostType.php @@ -74,7 +74,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void // of the form handling process. // See https://symfony.com/doc/current/form/events.html ->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) { - /** @var Post */ + /** @var Post $post */ $post = $event->getData(); if (null === $post->getSlug() && null !== $post->getTitle()) { $post->setSlug($this->slugger->slug($post->getTitle())->lower()); diff --git a/src/Repository/PostRepository.php b/src/Repository/PostRepository.php index cb49cb812..7af47c72c 100644 --- a/src/Repository/PostRepository.php +++ b/src/Repository/PostRepository.php @@ -96,8 +96,7 @@ public function findBySearchQuery(string $query, int $limit = Paginator::PAGE_SI */ private function extractSearchTerms(string $searchQuery): array { - $searchQuery = u($searchQuery)->replaceMatches('/[[:space:]]+/', ' ')->trim(); - $terms = array_unique($searchQuery->split(' ')); + $terms = array_unique(u($searchQuery)->replaceMatches('/[[:space:]]+/', ' ')->trim()->split(' ')); // ignore the search terms that are too short return array_filter($terms, static function ($term) { diff --git a/src/Twig/SourceCodeExtension.php b/src/Twig/SourceCodeExtension.php index 01324808e..b5888f7c9 100644 --- a/src/Twig/SourceCodeExtension.php +++ b/src/Twig/SourceCodeExtension.php @@ -80,10 +80,7 @@ public function linkSourceFile(Environment $twig, string $file, int $line): stri ); } - /** - * @param string|TemplateWrapper $template - */ - public function showSourceCode(Environment $twig, $template): string + public function showSourceCode(Environment $twig, string|TemplateWrapper $template): string { return $twig->render('debug/source_code.html.twig', [ 'controller' => $this->getController(),