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

IBX-8470: Upgraded codebase to Symfony 6 #7

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
21 changes: 11 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
],
"require": {
"php": ">=8.3",
"ibexa/core": "~5.0.x-dev",
"symfony/config": "^5.4",
"symfony/dependency-injection": "^5.4",
"symfony/event-dispatcher": "^5.4",
"ibexa/core": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"symfony/config": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/event-dispatcher": "^6.4",
"symfony/event-dispatcher-contracts": "^2.2",
"symfony/http-foundation": "^5.4",
"symfony/http-kernel": "^5.4",
"symfony/yaml": "^5.4"
"symfony/http-foundation": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/yaml": "^6.4"
},
"require-dev": {
"ibexa/behat": "~5.0.x-dev",
"ibexa/behat": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"ibexa/code-style": "~2.0.0",
"ibexa/doctrine-schema": "~5.0.x-dev",
"ibexa/doctrine-schema": "dev-ibx-8470-symfony-6 as 5.0.x-dev",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-symfony": "^1.3",
Expand Down Expand Up @@ -60,6 +60,7 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": false
}
}
2 changes: 2 additions & 0 deletions src/bundle/DependencyInjection/IbexaCoreSearchExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ final class IbexaCoreSearchExtension extends Extension implements PrependExtensi
{
/**
* @param array<string, mixed> $configs
*
* @throws \Exception
*/
public function load(array $configs, ContainerBuilder $container): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ protected function getComparisonOperator(FieldValueCriterion $criterion): string
));
}

/**
* @return mixed
*/
protected function getComparisonValue(FieldValueCriterion $criterion)
protected function getComparisonValue(FieldValueCriterion $criterion): mixed
{
return $criterion->getValue();
}
Expand Down
16 changes: 8 additions & 8 deletions src/contracts/Values/Query/AbstractCriterionQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
*/
abstract class AbstractCriterionQuery
{
public const DEFAULT_LIMIT = 25;
public const int DEFAULT_LIMIT = 25;

/** @var TCriterion|null */
/** @phpstan-var TCriterion|null */
private ?CriterionInterface $query;

/** @var TSortClause[] */
/** @phpstan-var TSortClause[] */
private array $sortClauses;

private ?int $limit;

private int $offset;

/**
* @param TSortClause[]|null $sortClauses
* @param TCriterion|null $query
* @phpstan-param TSortClause[]|null $sortClauses
* @phpstan-param TCriterion|null $query
*/
public function __construct(
?CriterionInterface $query = null,
Expand All @@ -45,15 +45,15 @@ public function __construct(
}

/**
* @param TCriterion|null $criterion
* @phpstan-param TCriterion|null $criterion
*/
final public function setQuery(?CriterionInterface $criterion): void
{
$this->query = $criterion;
}

/**
* @return TCriterion|null
* @phpstan-return TCriterion|null
*/
final public function getQuery(): ?CriterionInterface
{
Expand Down Expand Up @@ -86,7 +86,7 @@ final public function setLimit(?int $limit): void
}

/**
* @return TSortClause[]
* @phpstan-return TSortClause[]
*/
final public function getSortClauses(): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/Values/Query/AbstractSortClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
abstract class AbstractSortClause
{
/** @final */
public const SORT_ASC = SortDirection::ASC;
public const string SORT_ASC = SortDirection::ASC;

/** @final */
public const SORT_DESC = SortDirection::DESC;
public const string SORT_DESC = SortDirection::DESC;

/**
* Sort direction.
Expand Down
37 changes: 15 additions & 22 deletions src/contracts/Values/Query/Criterion/FieldValueCriterion.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,33 @@
class FieldValueCriterion implements CriterionInterface
{
/** @final */
public const COMPARISON_EQ = '=';
public const string COMPARISON_EQ = '=';
/** @final */
public const COMPARISON_NEQ = '<>';
public const string COMPARISON_NEQ = '<>';
/** @final */
public const COMPARISON_LT = '<';
public const string COMPARISON_LT = '<';
/** @final */
public const COMPARISON_LTE = '<=';
public const string COMPARISON_LTE = '<=';
/** @final */
public const COMPARISON_GT = '>';
public const string COMPARISON_GT = '>';
/** @final */
public const COMPARISON_GTE = '>=';
public const string COMPARISON_GTE = '>=';
/** @final */
public const COMPARISON_IN = 'IN';
public const string COMPARISON_IN = 'IN';
/** @final */
public const COMPARISON_NIN = 'NIN';
public const string COMPARISON_NIN = 'NIN';
/** @final */
public const COMPARISON_CONTAINS = 'CONTAINS';
public const string COMPARISON_CONTAINS = 'CONTAINS';
/** @final */
public const COMPARISON_MEMBER_OF = 'MEMBER_OF';
public const string COMPARISON_MEMBER_OF = 'MEMBER_OF';
/** @final */
public const COMPARISON_STARTS_WITH = 'STARTS_WITH';
public const string COMPARISON_STARTS_WITH = 'STARTS_WITH';
/** @final */
public const COMPARISON_ENDS_WITH = 'ENDS_WITH';
public const string COMPARISON_ENDS_WITH = 'ENDS_WITH';

private string $field;

/** @var mixed */
private $value;
private mixed $value;

private string $operator;

Expand All @@ -57,18 +56,12 @@ public function getField(): string
return $this->field;
}

/**
* @param mixed $value
*/
public function setValue($value): void
public function setValue(mixed $value): void
{
$this->value = $value;
}

/**
* @return mixed
*/
public function getValue()
public function getValue(): mixed
{
return $this->value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Values/Query/CriterionMapperInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface CriterionMapperInterface
public function canHandle(CriterionInterface $criterion): bool;

/**
* @param C $criterion
* @phpstan-param C $criterion
*/
public function handle(CriterionInterface $criterion, CriterionMapper $mapper): Expression;
}
4 changes: 2 additions & 2 deletions src/contracts/Values/Query/SortDirection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/
class SortDirection
{
public const ASC = 'ascending';
public const DESC = 'descending';
public const string ASC = 'ascending';
public const string DESC = 'descending';

/**
* @phpstan-assert-if-true self::ASC|self::DESC $value
Expand Down
Loading