Skip to content

Commit

Permalink
Merge branch 'symfony:2.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
smnandre authored Oct 12, 2024
2 parents 134362d + 9cde8b8 commit 89c71d1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Autocomplete/src/AutocompleteBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
final class AutocompleteBundle extends Bundle
{
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
$container->addCompilerPass(new AutocompleteFormTypePass());
}
Expand Down
3 changes: 3 additions & 0 deletions src/Autocomplete/src/AutocompleterRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public function getAutocompleter(string $alias): ?EntityAutocompleterInterface
return $this->autocompletersLocator->has($alias) ? $this->autocompletersLocator->get($alias) : null;
}

/**
* @return list<string>
*/
public function getAutocompleterNames(): array
{
return array_keys($this->autocompletersLocator->getProvidedServices());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
final class AutocompleteExtension extends Extension implements PrependExtensionInterface
{
public function prepend(ContainerBuilder $container)
public function prepend(ContainerBuilder $container): void
{
$bundles = $container->getParameter('kernel.bundles');

Expand All @@ -61,7 +61,7 @@ public function prepend(ContainerBuilder $container)
}
}

public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$this->registerBasicServices($container);
if (ContainerBuilder::willBeAvailable('symfony/form', Form::class, ['symfony/framework-bundle'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class AutocompleteFormTypePass implements CompilerPassInterface
/** @var string Tag applied to EntityAutocompleterInterface classes */
public const ENTITY_AUTOCOMPLETER_TAG = 'ux.entity_autocompleter';

public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
$this->processEntityAutocompleteFieldTag($container);
$this->processEntityAutocompleterTag($container);
}

private function processEntityAutocompleteFieldTag(ContainerBuilder $container)
private function processEntityAutocompleteFieldTag(ContainerBuilder $container): void
{
foreach ($container->findTaggedServiceIds(self::ENTITY_AUTOCOMPLETE_FIELD_TAG, true) as $serviceId => $tag) {
$serviceDefinition = $container->getDefinition($serviceId);
Expand Down Expand Up @@ -68,7 +68,7 @@ private function getAlias(string $serviceId, Definition $serviceDefinition, arra
return $attribute->getAlias() ?: AsEntityAutocompleteField::shortName($class);
}

private function processEntityAutocompleterTag(ContainerBuilder $container)
private function processEntityAutocompleterTag(ContainerBuilder $container): void
{
$servicesMap = [];
foreach ($container->findTaggedServiceIds(self::ENTITY_AUTOCOMPLETER_TAG, true) as $serviceId => $tag) {
Expand Down
8 changes: 4 additions & 4 deletions src/Autocomplete/src/Maker/MakeAutocompleteField.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function getCommandDescription(): string
return 'Generates an Ajax-autocomplete form field class for symfony/ux-autocomplete.';
}

public function configureCommand(Command $command, InputConfiguration $inputConfig)
public function configureCommand(Command $command, InputConfiguration $inputConfig): void
{
$command
->setHelp(<<<EOF
Expand All @@ -66,12 +66,12 @@ public function configureCommand(Command $command, InputConfiguration $inputConf
;
}

public function configureDependencies(DependencyBuilder $dependencies)
public function configureDependencies(DependencyBuilder $dependencies): void
{
$dependencies->addClassDependency(FormInterface::class, 'symfony/form');
}

public function interact(InputInterface $input, ConsoleStyle $io, Command $command)
public function interact(InputInterface $input, ConsoleStyle $io, Command $command): void
{
if (null === $this->doctrineHelper) {
throw new \LogicException('Somehow the DoctrineHelper service is missing from MakerBundle.');
Expand All @@ -94,7 +94,7 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
);
}

public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator)
public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator): void
{
if (null === $this->doctrineHelper) {
throw new \LogicException('Somehow the DoctrineHelper service is missing from MakerBundle.');
Expand Down

0 comments on commit 89c71d1

Please sign in to comment.