Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  Fix implicitly-required parameters
  minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench)
  Fix bad merge
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
2 parents 9c0ce8f + b3b29b7 commit dc9b5ef
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CacheWarmer/ProxyCacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function isOptional(): bool
return false;
}

public function warmUp(string $cacheDir, string $buildDir = null): array
public function warmUp(string $cacheDir, ?string $buildDir = null): array
{
$files = [];
foreach ($this->registry->getManagers() as $em) {
Expand Down
2 changes: 1 addition & 1 deletion ContainerAwareEventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(ContainerInterface $container, array $listeners = []
$this->listeners = $listeners;
}

public function dispatchEvent(string $eventName, EventArgs $eventArgs = null): void
public function dispatchEvent(string $eventName, ?EventArgs $eventArgs = null): void
{
if (!$this->initializedSubscribers) {
$this->initializeSubscribers();
Expand Down
2 changes: 1 addition & 1 deletion DataCollector/DoctrineDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
$this->managers = $registry->getManagerNames();
}

public function collect(Request $request, Response $response, \Throwable $exception = null): void
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
$this->data = [
'queries' => $this->collectQueries(),
Expand Down
4 changes: 2 additions & 2 deletions DependencyInjection/AbstractDoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected function setMappingDriverConfig(array $mappingConfig, string $mappingN
*
* Returns false when autodetection failed, an array of the completed information otherwise.
*/
protected function getMappingDriverBundleConfigDefaults(array $bundleConfig, \ReflectionClass $bundle, ContainerBuilder $container, string $bundleDir = null): array|false
protected function getMappingDriverBundleConfigDefaults(array $bundleConfig, \ReflectionClass $bundle, ContainerBuilder $container, ?string $bundleDir = null): array|false
{
$bundleClassDir = \dirname($bundle->getFileName());
$bundleDir ??= $bundleClassDir;
Expand Down Expand Up @@ -386,7 +386,7 @@ abstract protected function getMappingObjectDefaultName(): string;
/**
* Relative path from the bundle root to the directory where mapping files reside.
*/
abstract protected function getMappingResourceConfigDirectory(string $bundleDir = null): string;
abstract protected function getMappingResourceConfigDirectory(?string $bundleDir = null): string;

/**
* Extension used by the mapping files.
Expand Down
2 changes: 1 addition & 1 deletion Form/ChoiceList/IdReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function isIntId(): bool
*
* This method assumes that the object has a single-column ID.
*/
public function getIdValue(object $object = null): string
public function getIdValue(?object $object = null): string
{
if (!$object) {
return '';
Expand Down
6 changes: 3 additions & 3 deletions IdGenerator/UuidGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class UuidGenerator extends AbstractIdGenerator
private UuidFactory|NameBasedUuidFactory|RandomBasedUuidFactory|TimeBasedUuidFactory $factory;
private ?string $entityGetter = null;

public function __construct(UuidFactory $factory = null)
public function __construct(?UuidFactory $factory = null)
{
$this->protoFactory = $this->factory = $factory ?? new UuidFactory();
}
Expand All @@ -52,7 +52,7 @@ public function generateId(EntityManagerInterface $em, $entity): Uuid
return $this->factory->create();
}

public function nameBased(string $entityGetter, Uuid|string $namespace = null): static
public function nameBased(string $entityGetter, Uuid|string|null $namespace = null): static
{
$clone = clone $this;
$clone->factory = $clone->protoFactory->nameBased($namespace);
Expand All @@ -70,7 +70,7 @@ public function randomBased(): static
return $clone;
}

public function timeBased(Uuid|string $node = null): static
public function timeBased(Uuid|string|null $node = null): static
{
$clone = clone $this;
$clone->factory = $clone->protoFactory->timeBased($node);
Expand Down
2 changes: 1 addition & 1 deletion Messenger/AbstractDoctrineMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract class AbstractDoctrineMiddleware implements MiddlewareInterface
protected ManagerRegistry $managerRegistry;
protected ?string $entityManagerName;

public function __construct(ManagerRegistry $managerRegistry, string $entityManagerName = null)
public function __construct(ManagerRegistry $managerRegistry, ?string $entityManagerName = null)
{
$this->managerRegistry = $managerRegistry;
$this->entityManagerName = $entityManagerName;
Expand Down
2 changes: 1 addition & 1 deletion Messenger/DoctrineOpenTransactionLoggerMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DoctrineOpenTransactionLoggerMiddleware extends AbstractDoctrineMiddleware

public function __construct(
ManagerRegistry $managerRegistry,
string $entityManagerName = null,
?string $entityManagerName = null,
private readonly ?LoggerInterface $logger = null,
) {
parent::__construct($managerRegistry, $entityManagerName);
Expand Down
4 changes: 2 additions & 2 deletions Tests/ArgumentResolver/EntityValueResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,12 @@ public function testAlreadyResolved()
$this->assertSame([], $resolver->resolve($request, $argument));
}

private function createArgument(string $class = null, MapEntity $entity = null, string $name = 'arg', bool $isNullable = false): ArgumentMetadata
private function createArgument(?string $class = null, ?MapEntity $entity = null, string $name = 'arg', bool $isNullable = false): ArgumentMetadata
{
return new ArgumentMetadata($name, $class ?? \stdClass::class, false, false, null, $isNullable, $entity ? [$entity] : []);
}

private function createRegistry(ObjectManager $manager = null): ManagerRegistry&MockObject
private function createRegistry(?ObjectManager $manager = null): ManagerRegistry&MockObject
{
$registry = $this->getMockBuilder(ManagerRegistry::class)->getMock();

Expand Down
2 changes: 1 addition & 1 deletion Tests/DoctrineTestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class DoctrineTestHelper
/**
* Returns an entity manager for testing.
*/
public static function createTestEntityManager(Configuration $config = null): EntityManager
public static function createTestEntityManager(?Configuration $config = null): EntityManager
{
if (!\extension_loaded('pdo_sqlite')) {
TestCase::markTestSkipped('Extension pdo_sqlite is required.');
Expand Down
2 changes: 1 addition & 1 deletion Tests/Form/Type/EntityTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ public function testOverrideChoicesValuesWithCallable()
'em' => 'default',
'class' => self::ITEM_GROUP_CLASS,
'choice_label' => 'name',
'choice_value' => function (GroupableEntity $entity = null) {
'choice_value' => function (?GroupableEntity $entity = null) {
if (null === $entity) {
return '';
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/PropertyInfo/DoctrineExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function testTestGetPropertiesWithEmbedded()
/**
* @dataProvider typesProvider
*/
public function testExtract(string $property, array $type = null)
public function testExtract(string $property, ?array $type = null)
{
$this->assertEquals($type, $this->createExtractor()->getTypes(DoctrineDummy::class, $property, []));
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Validator/DoctrineLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function testFieldMappingsConfiguration()
/**
* @dataProvider regexpProvider
*/
public function testClassValidator(bool $expected, string $classValidatorRegexp = null)
public function testClassValidator(bool $expected, ?string $classValidatorRegexp = null)
{
$doctrineLoader = new DoctrineLoader(DoctrineTestHelper::createTestEntityManager(), $classValidatorRegexp, false);

Expand Down
16 changes: 8 additions & 8 deletions Validator/Constraints/UniqueEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ class UniqueEntity extends Constraint
*/
public function __construct(
array|string $fields,
string $message = null,
string $service = null,
string $em = null,
string $entityClass = null,
string $repositoryMethod = null,
string $errorPath = null,
bool|string|array $ignoreNull = null,
array $groups = null,
?string $message = null,
?string $service = null,
?string $em = null,
?string $entityClass = null,
?string $repositoryMethod = null,
?string $errorPath = null,
bool|string|array|null $ignoreNull = null,
?array $groups = null,
$payload = null,
array $options = []
) {
Expand Down

0 comments on commit dc9b5ef

Please sign in to comment.