Skip to content

Commit c3dd56a

Browse files
committed
Fix CS
1 parent 9213c77 commit c3dd56a

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- staging
1010
- main
1111

12+
env:
13+
fail-fast: true
14+
1215
jobs:
1316
integration-tests:
1417
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
@@ -24,8 +27,6 @@ jobs:
2427
MEILI_MASTER_KEY: masterKey
2528
MEILI_NO_ANALYTICS: true
2629
strategy:
27-
# only TEMP
28-
fail-fast: false
2930
matrix:
3031
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
3132
include:
@@ -76,7 +77,7 @@ jobs:
7677
- name: Install PHP
7778
uses: shivammathur/setup-php@v2
7879
with:
79-
php-version: '8.1'
80+
php-version: 8.3
8081

8182
- name: Validate composer.json and composer.lock
8283
run: composer validate

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)