Skip to content

Commit e2f7356

Browse files
committed
minor #18549 [Bundles] [Bridges] Convert to native return types (alexandre-daubois)
This PR was merged into the 7.0 branch. Discussion ---------- [Bundles] [Bridges] Convert to native return types Fix #18483 Commits ------- 0068934 [Bridges][Bundles] Convert to native return types
2 parents 9ecfd62 + 0068934 commit e2f7356

File tree

10 files changed

+20
-14
lines changed

10 files changed

+20
-14
lines changed

bundles/configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ the extension. You might want to change this to a more professional URL::
458458
{
459459
// ...
460460

461-
public function getNamespace()
461+
public function getNamespace(): string
462462
{
463463
return 'http://acme_company.com/schema/dic/hello';
464464
}
@@ -490,7 +490,7 @@ can place it anywhere you like. You should return this path as the base path::
490490
{
491491
// ...
492492

493-
public function getXsdValidationBasePath()
493+
public function getXsdValidationBasePath(): string
494494
{
495495
return __DIR__.'/../Resources/config/schema';
496496
}

bundles/extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This is how the extension of an AcmeHelloBundle should look like::
3434

3535
class AcmeHelloExtension extends Extension
3636
{
37-
public function load(array $configs, ContainerBuilder $container)
37+
public function load(array $configs, ContainerBuilder $container): void
3838
{
3939
// ... you'll load the files here later
4040
}

bundles/prepend_extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To give an Extension the power to do this, it needs to implement
3131
{
3232
// ...
3333

34-
public function prepend(ContainerBuilder $container)
34+
public function prepend(ContainerBuilder $container): void
3535
{
3636
// ...
3737
}

components/console/changing_default_command.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ name to the ``setDefaultCommand()`` method::
1515
#[AsCommand(name: 'hello:world')]
1616
class HelloWorldCommand extends Command
1717
{
18-
protected function configure()
18+
protected function configure(): void
1919
{
2020
$this->setDescription('Outputs "Hello World"');
2121
}
2222

23-
protected function execute(InputInterface $input, OutputInterface $output)
23+
protected function execute(InputInterface $input, OutputInterface $output): int
2424
{
2525
$output->writeln('Hello World');
26+
27+
return Command::SUCCESS;
2628
}
2729
}
2830

components/console/console_arguments.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Have a look at the following command that has three options::
2222
#[AsCommand(name: 'demo:args', description: 'Describe args behaviors')]
2323
class DemoArgsCommand extends Command
2424
{
25-
protected function configure()
25+
protected function configure(): void
2626
{
2727
$this
2828
->setDefinition(
@@ -34,7 +34,7 @@ Have a look at the following command that has three options::
3434
);
3535
}
3636

37-
protected function execute(InputInterface $input, OutputInterface $output)
37+
protected function execute(InputInterface $input, OutputInterface $output): int
3838
{
3939
// ...
4040
}

components/console/logger.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ You can rely on the logger to use this dependency inside a command::
4444
)]
4545
class MyCommand extends Command
4646
{
47-
protected function execute(InputInterface $input, OutputInterface $output)
47+
protected function execute(InputInterface $input, OutputInterface $output): int
4848
{
4949
$logger = new ConsoleLogger($output);
5050

5151
$myDependency = new MyDependency($logger);
5252
$myDependency->doStuff();
53+
54+
return Command::SUCCESS;
5355
}
5456
}
5557

components/dependency_injection/compilation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ class implementing the ``CompilerPassInterface``::
408408

409409
class CustomPass implements CompilerPassInterface
410410
{
411-
public function process(ContainerBuilder $container)
411+
public function process(ContainerBuilder $container): void
412412
{
413413
// ... do something during the compilation
414414
}

configuration/using_parameters_in_dic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ And set it in the constructor of ``Configuration`` via the ``Extension`` class::
135135
{
136136
// ...
137137

138-
public function getConfiguration(array $config, ContainerBuilder $container)
138+
public function getConfiguration(array $config, ContainerBuilder $container): Configuration
139139
{
140140
return new Configuration($container->getParameter('kernel.debug'));
141141
}

logging/monolog_console.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ The example above could then be rewritten as::
4747
) {
4848
}
4949

50-
protected function execute(InputInterface $input, OutputInterface $output)
50+
protected function execute(InputInterface $input, OutputInterface $output): int
5151
{
5252
$this->logger->debug('Some info');
5353
$this->logger->notice('Some more info');
54+
55+
return Command::SUCCESS;
5456
}
5557
}
5658

session.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ event::
14641464
) {
14651465
}
14661466

1467-
public function onInteractiveLogin(InteractiveLoginEvent $event)
1467+
public function onInteractiveLogin(InteractiveLoginEvent $event): void
14681468
{
14691469
$user = $event->getAuthenticationToken()->getUser();
14701470

@@ -1473,7 +1473,7 @@ event::
14731473
}
14741474
}
14751475

1476-
public static function getSubscribedEvents()
1476+
public static function getSubscribedEvents(): array
14771477
{
14781478
return [
14791479
SecurityEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin',

0 commit comments

Comments
 (0)