Skip to content

Commit

Permalink
Merge 4.x into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI authored Feb 7, 2024
2 parents d82400b + fb06e46 commit 669baba
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 35 deletions.
3 changes: 1 addition & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\AddSeeTestAnnotationRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;

Expand All @@ -33,7 +32,7 @@

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
PHPUnitSetList::PHPUNIT_90,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
]);

Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AbstractAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ final public function getPersistentParameters(): array
return $parameters;
}

final public function getPersistentParameter(string $name, $default = null)
final public function getPersistentParameter(string $name, mixed $default = null)
{
$parameters = $this->getPersistentParameters();

Expand Down
4 changes: 1 addition & 3 deletions src/Admin/AdminInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,9 @@ public function getBatchActions(): array;
public function getPersistentParameters(): array;

/**
* @param mixed $default
*
* @return mixed
*/
public function getPersistentParameter(string $name, $default = null);
public function getPersistentParameter(string $name, mixed $default = null);

/**
* Set the current child status.
Expand Down
3 changes: 1 addition & 2 deletions src/Exception/BadRequestParamHttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ final class BadRequestParamHttpException extends BadRequestHttpException
{
/**
* @param string|string[] $expectedTypes
* @param mixed $value
*/
public function __construct(
string $name,
$expectedTypes,
$value
mixed $value
) {
if (!\is_array($expectedTypes)) {
$expectedTypes = [$expectedTypes];
Expand Down
8 changes: 4 additions & 4 deletions src/Filter/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ final public function getFormName(): string
return str_replace('.', '__', $this->getName());
}

final public function getOption(string $name, $default = null)
final public function getOption(string $name, mixed $default = null)
{
if (\array_key_exists($name, $this->options)) {
return $this->options[$name];
Expand All @@ -81,7 +81,7 @@ final public function getOption(string $name, $default = null)
return $default;
}

final public function setOption(string $name, $value): void
final public function setOption(string $name, mixed $value): void
{
$this->options[$name] = $value;
}
Expand All @@ -96,7 +96,7 @@ final public function getFieldOptions(): array
return $this->getOption('field_options', []);
}

final public function getFieldOption(string $name, $default = null)
final public function getFieldOption(string $name, mixed $default = null)
{
if (isset($this->options['field_options'][$name]) && \is_array($this->options['field_options'])) {
return $this->options['field_options'][$name];
Expand All @@ -105,7 +105,7 @@ final public function getFieldOption(string $name, $default = null)
return $default;
}

final public function setFieldOption(string $name, $value): void
final public function setFieldOption(string $name, mixed $value): void
{
$this->options['field_options'][$name] = $value;
}
Expand Down
18 changes: 4 additions & 14 deletions src/Filter/FilterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,11 @@ public function getDefaultOptions(): array;
public function getOptions(): array;

/**
* @param mixed $default
*
* @return mixed
*/
public function getOption(string $name, $default = null);
public function getOption(string $name, mixed $default = null);

/**
* @param mixed $value
*/
public function setOption(string $name, $value): void;
public function setOption(string $name, mixed $value): void;

/**
* @param array<string, mixed> $options
Expand Down Expand Up @@ -112,16 +107,11 @@ public function getAssociationMapping(): array;
public function getFieldOptions(): array;

/**
* @param mixed $default
*
* @return mixed
*/
public function getFieldOption(string $name, $default = null);
public function getFieldOption(string $name, mixed $default = null);

/**
* @param mixed $value
*/
public function setFieldOption(string $name, $value): void;
public function setFieldOption(string $name, mixed $value): void;

public function getFieldType(): string;

Expand Down
2 changes: 1 addition & 1 deletion src/Object/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getOptions(): array
return $this->options;
}

public function getOption($name, $default = null)
public function getOption($name, mixed $default = null)
{
return \array_key_exists($name, $this->options) ? $this->options[$name] : $default;
}
Expand Down
10 changes: 2 additions & 8 deletions src/Route/AdminPoolLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,12 @@ public function __construct(
parent::__construct();
}

/**
* @param mixed $resource
*/
public function supports($resource, ?string $type = null): bool
public function supports(mixed $resource, ?string $type = null): bool
{
return self::ROUTE_TYPE_NAME === $type;
}

/**
* @param mixed $resource
*/
public function load($resource, ?string $type = null): SymfonyRouteCollection
public function load(mixed $resource, ?string $type = null): SymfonyRouteCollection
{
$collection = new SymfonyRouteCollection();
foreach ($this->pool->getAdminServiceCodes() as $code) {
Expand Down

0 comments on commit 669baba

Please sign in to comment.