Skip to content

Commit

Permalink
Merge branch '4.5.x' into 4.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Jan 7, 2023
2 parents 5b6c444 + acf2e84 commit 3ceffc6
Show file tree
Hide file tree
Showing 56 changed files with 135 additions and 251 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@1.2.0"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@3.0.0"
3 changes: 2 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
stability:
- "stable"
symfony-version:
Expand Down Expand Up @@ -95,7 +96,7 @@ jobs:
run: "composer config minimum-stability ${{ matrix.stability }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

Expand Down
4 changes: 1 addition & 3 deletions CacheWarmer/ProxyCacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ public function warmUp($cacheDir)
return [];
}

/**
* @return ClassMetadata[]
*/
/** @return ClassMetadata[] */
private function getClassesForProxyGeneration(DocumentManager $dm)
{
return array_filter($dm->getMetadataFactory()->getAllMetadata(), static function (ClassMetadata $metadata) {
Expand Down
6 changes: 2 additions & 4 deletions Command/ClearMetadataCacheDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function configure()
->setName('doctrine:mongodb:cache:clear-metadata')
->setDescription('Clear all metadata cache for a document manager.')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>doctrine:mongodb:cache:clear-metadata</info> command clears all metadata cache for the default document manager:
<info>./app/console doctrine:mongodb:cache:clear-metadata</info>
Expand All @@ -34,9 +34,7 @@ protected function configure()
);
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineODMCommand::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
Expand Down
6 changes: 2 additions & 4 deletions Command/CreateSchemaDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function configure()
$this
->setName('doctrine:mongodb:schema:create')
->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>doctrine:mongodb:schema:create</info> command creates the default document manager's schema:
<info>./app/console doctrine:mongodb:schema:create</info>
Expand All @@ -34,9 +34,7 @@ protected function configure()
);
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineODMCommand::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
Expand Down
8 changes: 2 additions & 6 deletions Command/DoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ public function __construct(?ManagerRegistry $registry = null)
$this->managerRegistry = $registry;
}

/**
* @deprecated since version 4.4
*/
/** @deprecated since version 4.4 */
public function setContainer(?ContainerInterface $container = null)
{
trigger_deprecation(
Expand Down Expand Up @@ -88,9 +86,7 @@ protected function getContainer()
return $this->container;
}

/**
* @param string $dmName
*/
/** @param string $dmName */
public static function setApplicationDocumentManager(Application $application, $dmName)
{
$dm = $application->getKernel()->getContainer()->get('doctrine_mongodb')->getManager($dmName);
Expand Down
6 changes: 2 additions & 4 deletions Command/DropSchemaDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function configure()
$this
->setName('doctrine:mongodb:schema:drop')
->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>doctrine:mongodb:schema:drop</info> command drops the default document manager's schema:
<info>./app/console doctrine:mongodb:schema:drop</info>
Expand All @@ -34,9 +34,7 @@ protected function configure()
);
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineODMCommand::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
Expand Down
6 changes: 2 additions & 4 deletions Command/GenerateHydratorsDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function configure()
$this
->setName('doctrine:mongodb:generate:hydrators')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>doctrine:mongodb:generate:hydrators</info> command generates hydrator classes for your documents:
<info>./app/console doctrine:mongodb:generate:hydrators</info>
Expand All @@ -33,9 +33,7 @@ protected function configure()
);
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineODMCommand::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
Expand Down
6 changes: 2 additions & 4 deletions Command/GenerateProxiesDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function configure()
$this
->setName('doctrine:mongodb:generate:proxies')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>doctrine:mongodb:generate:proxies</info> command generates proxy classes for your default document manager:
<info>./app/console doctrine:mongodb:generate:proxies</info>
Expand All @@ -33,9 +33,7 @@ protected function configure()
);
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineODMCommand::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
Expand Down
6 changes: 2 additions & 4 deletions Command/InfoDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function configure()
->setName('doctrine:mongodb:mapping:info')
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.')
->setDescription('Show basic information about all mapped documents.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>doctrine:mongodb:mapping:info</info> shows basic information about which
documents exist and possibly if their mapping information contains errors or not.
Expand All @@ -39,9 +39,7 @@ protected function configure()
);
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
$documentManagerName = $input->getOption('dm') ?
Expand Down
10 changes: 3 additions & 7 deletions Command/LoadDataFixturesDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ public function __construct(?ManagerRegistry $registry = null, ?KernelInterface
$this->fixturesLoader = $fixturesLoader;
}

/**
* @return bool
*/
/** @return bool */
public function isEnabled()
{
return parent::isEnabled() && class_exists(Loader::class);
Expand All @@ -54,7 +52,7 @@ protected function configure()
->addOption('group', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Only load fixtures that belong to this group (use with --services)')
->addOption('append', null, InputOption::VALUE_NONE, 'Append the data fixtures instead of flushing the database first.')
->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>doctrine:mongodb:fixtures:load</info> command loads data fixtures from your application:
<info>php %command.full_name%</info>
Expand All @@ -75,9 +73,7 @@ protected function configure()
);
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
$dm = $this->getManagerRegistry()->getManager($input->getOption('dm'));
Expand Down
4 changes: 1 addition & 3 deletions Command/QueryDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ protected function configure()
->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.');
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineODMCommand::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
Expand Down
6 changes: 2 additions & 4 deletions Command/ShardDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function configure()
$this
->setName('doctrine:mongodb:schema:shard')
->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>doctrine:mongodb:schema:shard</info> command shards collections based on their metadata:
<info>./app/console doctrine:mongodb:schema:shard</info>
Expand All @@ -34,9 +34,7 @@ protected function configure()
);
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineODMCommand::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
Expand Down
8 changes: 2 additions & 6 deletions Command/TailCursorDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ protected function configure()
->addOption('sleep-time', null, InputOption::VALUE_REQUIRED, 'The number of seconds to wait between two checks.', '10');
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
trigger_deprecation(
Expand Down Expand Up @@ -109,9 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 0;
}

/**
* @return ContainerInterface
*/
/** @return ContainerInterface */
protected function getContainer()
{
return $this->container;
Expand Down
6 changes: 2 additions & 4 deletions Command/UpdateSchemaDoctrineODMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function configure()
$this
->setName('doctrine:mongodb:schema:update')
->addOption('dm', null, InputOption::VALUE_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
->setHelp(<<<'EOT'
The <info>doctrine:mongodb:schema:update</info> command updates the default document manager's schema:
<info>./app/console doctrine:mongodb:schema:update</info>
Expand All @@ -34,9 +34,7 @@ protected function configure()
);
}

/**
* @return int
*/
/** @return int */
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineODMCommand::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
Expand Down
4 changes: 1 addition & 3 deletions Cursor/TailableCursorProcessorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*/
interface TailableCursorProcessorInterface
{
/**
* @param mixed $document
*/
/** @param mixed $document */
public function process($document);
}
4 changes: 1 addition & 3 deletions DataCollector/CommandDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ public function getTime(): int
return $this->data['time'];
}

/**
* @return array<array{database: string, command: stdClass, durationMicros: int}>
*/
/** @return array<array{database: string, command: stdClass, durationMicros: int}> */
public function getCommands(): array
{
return $this->data['commands'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class DoctrineMongoDBMappingsPass extends RegisterMappingsPass
public function __construct($driver, array $namespaces, array $managerParameters, $enabledParameter = false, array $aliasMap = [])
{
$managerParameters[] = 'doctrine_mongodb.odm.default_document_manager';

parent::__construct(
$driver,
$namespaces,
Expand Down
8 changes: 2 additions & 6 deletions DependencyInjection/DoctrineMongoDBExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,7 @@ protected function loadDocumentManagerBundlesMappingInformation(array $documentM
$odmConfigDef->addMethodCall('setDocumentNamespaces', [$this->aliasMap]);
}

/**
* @param string $name
*/
/** @param string $name */
protected function getObjectManagerElementName($name): string
{
return 'doctrine_mongodb.odm.' . $name;
Expand Down Expand Up @@ -516,9 +514,7 @@ public function getNamespace()
return 'http://symfony.com/schema/dic/doctrine/odm/mongodb';
}

/**
* @return string
*/
/** @return string */
public function getXsdValidationBasePath()
{
return __DIR__ . '/../Resources/config/schema';
Expand Down
4 changes: 1 addition & 3 deletions Form/ChoiceList/MongoDBQueryBuilderLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ public function __construct($queryBuilder, ?ObjectManager $manager = null, $clas
$this->queryBuilder = $queryBuilder;
}

/**
* @return object[]
*/
/** @return object[] */
public function getEntities(): array
{
return array_values($this->queryBuilder->getQuery()->execute()->toArray());
Expand Down
8 changes: 2 additions & 6 deletions Form/DoctrineMongoDBExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@ public function __construct(ManagerRegistry $registry)
$this->registry = $registry;
}

/**
* @return FormTypeInterface[]
*/
/** @return FormTypeInterface[] */
protected function loadTypes()
{
return [
new Type\DocumentType($this->registry),
];
}

/**
* @return FormTypeGuesserInterface|null
*/
/** @return FormTypeGuesserInterface|null */
protected function loadTypeGuesser()
{
return new DoctrineMongoDBTypeGuesser($this->registry);
Expand Down
Loading

0 comments on commit 3ceffc6

Please sign in to comment.