Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc minor fixes #1458

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Form/PostType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
3 changes: 1 addition & 2 deletions src/Repository/PostRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 1 addition & 4 deletions src/Twig/SourceCodeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down