Skip to content

Commit 403f954

Browse files
committed
Fix CS
1 parent 9213c77 commit 403f954

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/Collection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function map(callable $callback)
6565
*
6666
* @return static
6767
*/
68-
public function filter(callable $callback = null)
68+
public function filter(?callable $callback = null)
6969
{
7070
if (null !== $callback) {
7171
return new self(array_filter($this->items, $callback, ARRAY_FILTER_USE_BOTH));
@@ -143,7 +143,7 @@ public function unique($key = null, bool $strict = false)
143143
/**
144144
* Get the first item from the collection passing the given truth test.
145145
*/
146-
public function first(callable $callback = null, $default = null)
146+
public function first(?callable $callback = null, $default = null)
147147
{
148148
if (is_null($callback)) {
149149
if (empty($this->items)) {
@@ -339,7 +339,7 @@ private static function existsInArray($array, $key): bool
339339
return array_key_exists($key, $array);
340340
}
341341

342-
private function operatorForWhere(string $key, string $operator = null, $value = null): \Closure
342+
private function operatorForWhere(string $key, ?string $operator = null, $value = null): \Closure
343343
{
344344
if (1 === func_num_args()) {
345345
$value = true;

src/Model/Aggregator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function getEntityClassFromObjectID(string $objectId): string
7373
throw new EntityNotFoundInObjectID("Entity class from ObjectID $objectId not found.");
7474
}
7575

76-
public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []): array
76+
public function normalize(NormalizerInterface $normalizer, ?string $format = null, array $context = []): array
7777
{
7878
return array_merge(['objectID' => $this->objectID], $normalizer->normalize($this->entity, $format, $context));
7979
}

src/SearchableEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(
3838
string $indexUid,
3939
$entity,
4040
ClassMetadata $entityMetadata,
41-
NormalizerInterface $normalizer = null,
41+
?NormalizerInterface $normalizer = null,
4242
array $extra = []
4343
) {
4444
$this->indexUid = $indexUid;

src/Services/MeilisearchService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class MeilisearchService implements SearchService
4242
private array $classToSerializerGroup;
4343
private array $indexIfMapping;
4444

45-
public function __construct(NormalizerInterface $normalizer, Engine $engine, array $configuration, PropertyAccessorInterface $propertyAccessor = null)
45+
public function __construct(NormalizerInterface $normalizer, Engine $engine, array $configuration, ?PropertyAccessorInterface $propertyAccessor = null)
4646
{
4747
$this->normalizer = $normalizer;
4848
$this->engine = $engine;

src/Services/UnixTimestampNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ final class UnixTimestampNormalizer implements NormalizerInterface
1111
/**
1212
* @param \DateTimeInterface $object
1313
*/
14-
public function normalize($object, string $format = null, array $context = []): int
14+
public function normalize($object, ?string $format = null, array $context = []): int
1515
{
1616
return $object->getTimestamp();
1717
}
1818

1919
/**
2020
* @param mixed $data
2121
*/
22-
public function supportsNormalization($data, string $format = null, array $context = []): bool
22+
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
2323
{
2424
return $data instanceof \DateTimeInterface && true === ($context['meilisearch'] ?? null);
2525
}

tests/BaseKernelTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function setUp(): void
4242
$this->cleanUp();
4343
}
4444

45-
protected function createPost(int $id = null): Post
45+
protected function createPost(?int $id = null): Post
4646
{
4747
$post = new Post();
4848
$post->setTitle('Test Post');
@@ -83,7 +83,7 @@ protected function createSearchablePost(): SearchableEntity
8383
);
8484
}
8585

86-
protected function createComment(int $id = null): Comment
86+
protected function createComment(?int $id = null): Comment
8787
{
8888
$post = new Post(['title' => 'What a post!']);
8989
$comment = new Comment();
@@ -101,7 +101,7 @@ protected function createComment(int $id = null): Comment
101101
return $comment;
102102
}
103103

104-
protected function createImage(int $id = null): Image
104+
protected function createImage(?int $id = null): Image
105105
{
106106
$image = new Image();
107107
$image->setUrl('https://docs.meilisearch.com/logo.png');

0 commit comments

Comments
 (0)