Skip to content

[Bundles] [Bridges] Convert to native return types #18549

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

Merged
merged 1 commit into from
Jul 12, 2023
Merged
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
4 changes: 2 additions & 2 deletions bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ the extension. You might want to change this to a more professional URL::
{
// ...

public function getNamespace()
public function getNamespace(): string
{
return 'http://acme_company.com/schema/dic/hello';
}
Expand Down Expand Up @@ -490,7 +490,7 @@ can place it anywhere you like. You should return this path as the base path::
{
// ...

public function getXsdValidationBasePath()
public function getXsdValidationBasePath(): string
{
return __DIR__.'/../Resources/config/schema';
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This is how the extension of an AcmeHelloBundle should look like::

class AcmeHelloExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
// ... you'll load the files here later
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/prepend_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To give an Extension the power to do this, it needs to implement
{
// ...

public function prepend(ContainerBuilder $container)
public function prepend(ContainerBuilder $container): void
{
// ...
}
Expand Down
6 changes: 4 additions & 2 deletions components/console/changing_default_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ name to the ``setDefaultCommand()`` method::
#[AsCommand(name: 'hello:world')]
class HelloWorldCommand extends Command
{
protected function configure()
protected function configure(): void
{
$this->setDescription('Outputs "Hello World"');
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Hello World');

return Command::SUCCESS;
}
}

Expand Down
4 changes: 2 additions & 2 deletions components/console/console_arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Have a look at the following command that has three options::
#[AsCommand(name: 'demo:args', description: 'Describe args behaviors')]
class DemoArgsCommand extends Command
{
protected function configure()
protected function configure(): void
{
$this
->setDefinition(
Expand All @@ -34,7 +34,7 @@ Have a look at the following command that has three options::
);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
// ...
}
Expand Down
4 changes: 3 additions & 1 deletion components/console/logger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ You can rely on the logger to use this dependency inside a command::
)]
class MyCommand extends Command
{
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$logger = new ConsoleLogger($output);

$myDependency = new MyDependency($logger);
$myDependency->doStuff();

return Command::SUCCESS;
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class implementing the ``CompilerPassInterface``::

class CustomPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
// ... do something during the compilation
}
Expand Down
2 changes: 1 addition & 1 deletion configuration/using_parameters_in_dic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ And set it in the constructor of ``Configuration`` via the ``Extension`` class::
{
// ...

public function getConfiguration(array $config, ContainerBuilder $container)
public function getConfiguration(array $config, ContainerBuilder $container): Configuration
{
return new Configuration($container->getParameter('kernel.debug'));
}
Expand Down
2 changes: 1 addition & 1 deletion console/calling_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ method)::
{
// ...

protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$command = $this->getApplication()->find('demo:greet');

Expand Down
2 changes: 1 addition & 1 deletion console/verbosity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ level. For example::
OutputInterface::VERBOSITY_VERBOSE
);

return 0;
return Command::SUCCESS;
}
}

Expand Down
4 changes: 3 additions & 1 deletion logging/monolog_console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ The example above could then be rewritten as::
) {
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->logger->debug('Some info');
$this->logger->notice('Some more info');

return Command::SUCCESS;
}
}

Expand Down
4 changes: 2 additions & 2 deletions session.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ event::
) {
}

public function onInteractiveLogin(InteractiveLoginEvent $event)
public function onInteractiveLogin(InteractiveLoginEvent $event): void
{
$user = $event->getAuthenticationToken()->getUser();

Expand All @@ -1473,7 +1473,7 @@ event::
}
}

public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
SecurityEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin',
Expand Down