Skip to content

Commit d802a81

Browse files
committed
minor #1458 Misc minor fixes (javiereguiluz)
This PR was merged into the main branch. Discussion ---------- Misc minor fixes Found with PHPStorm "inspect code" feature. Commits ------- a46453f Misc minor fixes
2 parents f59041d + a46453f commit d802a81

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/Form/PostType.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
7474
// of the form handling process.
7575
// See https://symfony.com/doc/current/form/events.html
7676
->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) {
77-
/** @var Post */
77+
/** @var Post $post */
7878
$post = $event->getData();
7979
if (null === $post->getSlug() && null !== $post->getTitle()) {
8080
$post->setSlug($this->slugger->slug($post->getTitle())->lower());

src/Repository/PostRepository.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ public function findBySearchQuery(string $query, int $limit = Paginator::PAGE_SI
9696
*/
9797
private function extractSearchTerms(string $searchQuery): array
9898
{
99-
$searchQuery = u($searchQuery)->replaceMatches('/[[:space:]]+/', ' ')->trim();
100-
$terms = array_unique($searchQuery->split(' '));
99+
$terms = array_unique(u($searchQuery)->replaceMatches('/[[:space:]]+/', ' ')->trim()->split(' '));
101100

102101
// ignore the search terms that are too short
103102
return array_filter($terms, static function ($term) {

src/Twig/SourceCodeExtension.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ public function linkSourceFile(Environment $twig, string $file, int $line): stri
8080
);
8181
}
8282

83-
/**
84-
* @param string|TemplateWrapper $template
85-
*/
86-
public function showSourceCode(Environment $twig, $template): string
83+
public function showSourceCode(Environment $twig, string|TemplateWrapper $template): string
8784
{
8885
return $twig->render('debug/source_code.html.twig', [
8986
'controller' => $this->getController(),

0 commit comments

Comments
 (0)