Skip to content

Commit

Permalink
fix deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
alexz707 committed Jan 15, 2025
1 parent e622f64 commit f8c3ef2
Show file tree
Hide file tree
Showing 29 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/Command/DeploymentReindexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class DeploymentReindexCommand extends AbstractCommand
public function __construct(
private readonly EnqueueServiceInterface $enqueueService,
private readonly ClassDefinitionReindexServiceInterface $classDefinitionReindexService,
string $name = null
?string $name = null
) {
parent::__construct($name);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ReindexItemsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class ReindexItemsCommand extends AbstractCommand

public function __construct(
private readonly ReindexServiceInterface $reindexService,
string $name = null
?string $name = null
) {
parent::__construct($name);
}
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function getConfigTreeBuilder(): TreeBuilder
return $treeBuilder;
}

private function buildVariableNode(string $name, array $defaultValue = [], string $documentation = null): NodeDefinition
private function buildVariableNode(string $name, array $defaultValue = [], ?string $documentation = null): NodeDefinition
{
$node = new VariableNodeDefinition($name);
if ($documentation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

trait SystemFieldTrait
{
public function getPath(string $subField = null): string
public function getPath(?string $subField = null): string
{
$path = FieldCategory::SYSTEM_FIELDS->value . '.' . $this->value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
private readonly SearchInformation $searchInformation,
mixed $message = '',
mixed $code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/DefaultSearch/SearchFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
private readonly SearchInformation $searchInformation,
mixed $message = '',
mixed $code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/QueryLanguage/ParsingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
private readonly ?Token $token,
?string $message = null,
private readonly ?int $position = null,
Exception $previous = null
?Exception $previous = null
) {
$message = $message ?? sprintf('Expected %s, found %s.', $expected, $found);

Expand Down
2 changes: 1 addition & 1 deletion src/Model/DefaultSearch/Aggregation/AggregationList.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
) {
}

public function addAggregation(Aggregation $aggregation = null): AggregationList
public function addAggregation(?Aggregation $aggregation = null): AggregationList
{
if ($aggregation !== null) {
$this->aggregations[] = $aggregation;
Expand Down
2 changes: 1 addition & 1 deletion src/Model/DefaultSearch/DefaultSearchInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
interface DefaultSearchInterface extends AdapterSearchInterface
{
public function addQuery(QueryInterface $query = null): DefaultSearchInterface;
public function addQuery(?QueryInterface $query = null): DefaultSearchInterface;

public function addSort(FieldSort $sort): DefaultSearchInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/DefaultSearch/Query/QueryList.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
) {
}

public function addQuery(QueryInterface $query = null): QueryList
public function addQuery(?QueryInterface $query = null): QueryList
{
if ($query instanceof BoolQuery && !$query->isEmpty()) {
if ($this->boolQuery !== null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Model/DefaultSearch/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function setSource(bool|array|string|null $source): DefaultSearchInterfac
return $this;
}

public function addQuery(QueryInterface $query = null): DefaultSearchInterface
public function addQuery(?QueryInterface $query = null): DefaultSearchInterface
{
$this->queryList->addQuery($query);

Expand Down
2 changes: 1 addition & 1 deletion src/Model/DefaultSearch/Sort/FieldSortList.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
) {
}

public function addSort(FieldSort $sort = null): FieldSortList
public function addSort(?FieldSort $sort = null): FieldSortList
{
if ($sort !== null) {
$this->sort[] = $sort;
Expand Down
2 changes: 1 addition & 1 deletion src/SearchIndexAdapter/DataObject/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public function getInheritedData(
mixed $value,
string $key,
?string $language = null,
callable $callback = null
?callable $callback = null
): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getInheritedData(
mixed $value,
string $key,
?string $language = null,
callable $callback = null
?callable $callback = null
): array {
if (!$this->fieldDefinition->isEmpty($value)) {
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function getInheritedData(
mixed $value,
string $key,
?string $language = null,
callable $callback = null
?callable $callback = null
): array {
$classificationStore = $this->getClassificationStoreDefinition();
$languages = $this->getValidLanguages($classificationStore);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getInheritedData(
mixed $value,
string $key,
?string $language = null,
callable $callback = null
?callable $callback = null
): array {
$indexData = $this->getIndexData($value);
if (empty($indexData)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getInheritedData(
mixed $value,
string $key,
?string $language = null,
callable $callback = null
?callable $callback = null
): array {
if (!$value instanceof Objectbrick) {
return [];
Expand Down
4 changes: 2 additions & 2 deletions src/SearchIndexAdapter/DefaultSearch/DefaultSearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function reindex(string $indexName, array $mapping): void
$this->switchIndexAliasAndCleanup($indexName, $oldIndexName, $newIndexName);
}

public function createIndex(string $indexName, array $mappings = null): DefaultSearchService
public function createIndex(string $indexName, ?array $mappings = null): DefaultSearchService
{
$this->deleteIndex($indexName, true);

Expand Down Expand Up @@ -161,7 +161,7 @@ public function addAlias(string $aliasName, string $indexName): array
return $this->indexAliasService->addAlias($aliasName, $indexName);
}

public function existsAlias(string $aliasName, string $indexName = null): bool
public function existsAlias(string $aliasName, ?string $indexName = null): bool
{
return $this->indexAliasService->existsAlias($aliasName, $indexName);
}
Expand Down
2 changes: 1 addition & 1 deletion src/SearchIndexAdapter/DefaultSearch/IndexAliasService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function addAlias(string $aliasName, string $indexName): array
return $this->client->updateIndexAliases($params);
}

public function existsAlias(string $aliasName, string $indexName = null): bool
public function existsAlias(string $aliasName, ?string $indexName = null): bool
{
return $this->client->existsIndexAlias([
'name' => $aliasName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public function __construct(
private MappingAnalyzerServiceInterface $mappingAnalyzerService,
string $defaultLanguage = null
?string $defaultLanguage = null
) {
$this->defaultLocale = $defaultLanguage ?? Tool::getDefaultLanguage();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ private function getElementPosition(SearchInterface $search, int $elementId): ?i

private function createDefaultSearch(
SearchInterface $search,
int $pageSize = null,
SearchResult $searchAfterSearchResult = null
?int $pageSize = null,
?SearchResult $searchAfterSearchResult = null
): Search {
$pageSize = $pageSize ?? $search->getPageSize();

Expand Down
2 changes: 1 addition & 1 deletion src/SearchIndexAdapter/IndexAliasServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface IndexAliasServiceInterface
{
public function addAlias(string $aliasName, string $indexName): array;

public function existsAlias(string $aliasName, string $indexName = null): bool;
public function existsAlias(string $aliasName, ?string $indexName = null): bool;

public function deleteAlias(string $indexName, string $aliasName): array;

Expand Down
4 changes: 2 additions & 2 deletions src/SearchIndexAdapter/SearchIndexServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public function getCurrentIndexVersion(string $indexName): string;
*/
public function reindex(string $indexName, array $mapping): void;

public function createIndex(string $indexName, array $mappings = null): self;
public function createIndex(string $indexName, ?array $mappings = null): self;

public function addAlias(string $aliasName, string $indexName): array;

public function existsAlias(string $aliasName, string $indexName = null): bool;
public function existsAlias(string $aliasName, ?string $indexName = null): bool;

public function deleteAlias(string $indexName, string $aliasName): array;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
public function denormalize(
mixed $data,
string $type,
string $format = null,
?string $format = null,
array $context = []
): AssetSearchResultItem {

Expand Down Expand Up @@ -80,7 +80,7 @@ public function denormalize(

}

public function supportsDenormalization(mixed $data, string $type, string $format = null): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null): bool
{
return is_array($data) && is_subclass_of($type, AssetSearchResultItem::class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
public function denormalize(
mixed $data,
string $type,
string $format = null,
?string $format = null,
array $context = []
): DataObjectSearchResultItem {

Expand Down Expand Up @@ -92,7 +92,7 @@ public function denormalize(

}

public function supportsDenormalization(mixed $data, string $type, string $format = null): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null): bool
{
return is_array($data) && is_subclass_of($type, DataObjectSearchResultItem::class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(
public function denormalize(
mixed $data,
string $type,
string $format = null,
?string $format = null,
array $context = []
): DocumentSearchResultItem {

Expand Down Expand Up @@ -74,7 +74,7 @@ public function denormalize(
->setHasWorkflowWithPermissions(SystemField::HAS_WORKFLOW_WITH_PERMISSIONS->getData($data));
}

public function supportsDenormalization(mixed $data, string $type, string $format = null): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null): bool
{
return is_array($data) && is_subclass_of($type, DocumentSearchResultItem::class);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Service/Serializer/Normalizer/AssetNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct(
) {
}

public function normalize(mixed $object, string $format = null, array $context = []): array
public function normalize(mixed $object, ?string $format = null, array $context = []): array
{
$skipLazyLoadedFields = SerializerContext::SKIP_LAZY_LOADED_FIELDS->containedInContext($context);

Expand All @@ -63,7 +63,7 @@ public function normalize(mixed $object, string $format = null, array $context =
return [];
}

public function supportsNormalization(mixed $data, string $format = null): bool
public function supportsNormalization(mixed $data, ?string $format = null): bool
{
return $data instanceof Asset;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Service/Serializer/Normalizer/DataObjectNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(
*
* @throws Exception
*/
public function normalize(mixed $object, string $format = null, array $context = []): array
public function normalize(mixed $object, ?string $format = null, array $context = []): array
{
$skipLazyLoadedFields = SerializerContext::SKIP_LAZY_LOADED_FIELDS->containedInContext($context);

Expand All @@ -69,7 +69,7 @@ public function normalize(mixed $object, string $format = null, array $context =
return [];
}

public function supportsNormalization(mixed $data, string $format = null): bool
public function supportsNormalization(mixed $data, ?string $format = null): bool
{
return $data instanceof AbstractObject;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Service/Serializer/Normalizer/DocumentNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(
) {
}

public function normalize(mixed $object, string $format = null, array $context = []): array
public function normalize(mixed $object, ?string $format = null, array $context = []): array
{
$skipLazyLoadedFields = SerializerContext::SKIP_LAZY_LOADED_FIELDS->containedInContext($context);

Expand All @@ -59,7 +59,7 @@ public function normalize(mixed $object, string $format = null, array $context =
return [];
}

public function supportsNormalization(mixed $data, string $format = null): bool
public function supportsNormalization(mixed $data, ?string $format = null): bool
{
return $data instanceof Document;
}
Expand Down

0 comments on commit f8c3ef2

Please sign in to comment.