Skip to content

Commit 2c0ad1e

Browse files
jrushlowweaverryan
authored andcommitted
add return types for symfony 6
1 parent 9862577 commit 2c0ad1e

33 files changed

+113
-139
lines changed

src/Command/MakerCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public function __construct(MakerInterface $maker, FileManager $fileManager, Gen
5050
parent::__construct();
5151
}
5252

53-
protected function configure()
53+
protected function configure(): void
5454
{
5555
$this->maker->configureCommand($this, $this->inputConfig);
5656
}
5757

58-
protected function initialize(InputInterface $input, OutputInterface $output)
58+
protected function initialize(InputInterface $input, OutputInterface $output): void
5959
{
6060
$this->io = new ConsoleStyle($input, $output);
6161
$this->fileManager->setIO($this->io);
@@ -74,7 +74,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
7474
}
7575
}
7676

77-
protected function interact(InputInterface $input, OutputInterface $output)
77+
protected function interact(InputInterface $input, OutputInterface $output): void
7878
{
7979
if (!$this->fileManager->isNamespaceConfiguredToAutoload($this->generator->getRootNamespace())) {
8080
$this->io->note([
@@ -111,7 +111,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
111111
return 0;
112112
}
113113

114-
public function setApplication(Application $application = null)
114+
public function setApplication(Application $application = null): void
115115
{
116116
parent::setApplication($application);
117117

@@ -127,7 +127,7 @@ public function setApplication(Application $application = null)
127127
/**
128128
* @internal Used for testing commands
129129
*/
130-
public function setCheckDependencies(bool $checkDeps)
130+
public function setCheckDependencies(bool $checkDeps): void
131131
{
132132
$this->checkDependencies = $checkDeps;
133133
}

src/ConsoleStyle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public function __construct(InputInterface $input, OutputInterface $output)
3030
parent::__construct($input, $output);
3131
}
3232

33-
public function success($message)
33+
public function success($message): void
3434
{
3535
$this->writeln('<fg=green;options=bold,underscore>OK</> '.$message);
3636
}
3737

38-
public function comment($message)
38+
public function comment($message): void
3939
{
4040
$this->text($message);
4141
}

src/DependencyBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class DependencyBuilder
2525
* the user if other required dependencies are missing. An example
2626
* is the "validator" when trying to work with forms.
2727
*/
28-
public function addClassDependency(string $class, string $package, bool $required = true, bool $devDependency = false)
28+
public function addClassDependency(string $class, string $package, bool $required = true, bool $devDependency = false): void
2929
{
3030
if ($devDependency) {
3131
$this->devDependencies[] = [
@@ -42,7 +42,7 @@ public function addClassDependency(string $class, string $package, bool $require
4242
}
4343
}
4444

45-
public function requirePHP71()
45+
public function requirePHP71(): void
4646
{
4747
// no-op - MakerBundle now required PHP 7.1
4848
}

src/DependencyInjection/CompilerPass/MakeCommandRegistrationPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MakeCommandRegistrationPass implements CompilerPassInterface
2525
{
2626
public const MAKER_TAG = 'maker.command';
2727

28-
public function process(ContainerBuilder $container)
28+
public function process(ContainerBuilder $container): void
2929
{
3030
foreach ($container->findTaggedServiceIds(self::MAKER_TAG) as $id => $tags) {
3131
$def = $container->getDefinition($id);

src/DependencyInjection/CompilerPass/RemoveMissingParametersPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
class RemoveMissingParametersPass implements CompilerPassInterface
2323
{
24-
public function process(ContainerBuilder $container)
24+
public function process(ContainerBuilder $container): void
2525
{
2626
if (!$container->hasParameter('twig.default_path')) {
2727
$container->getDefinition('maker.file_manager')

src/DependencyInjection/CompilerPass/SetDoctrineAnnotatedPrefixesPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class SetDoctrineAnnotatedPrefixesPass implements CompilerPassInterface
2222
{
23-
public function process(ContainerBuilder $container)
23+
public function process(ContainerBuilder $container): void
2424
{
2525
$annotatedPrefixes = null;
2626

src/DependencyInjection/CompilerPass/SetDoctrineManagerRegistryClassPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class SetDoctrineManagerRegistryClassPass implements CompilerPassInterface
2222
{
23-
public function process(ContainerBuilder $container)
23+
public function process(ContainerBuilder $container): void
2424
{
2525
if ($container->hasAlias(ManagerRegistry::class)) {
2626
$definition = $container->getDefinition('maker.entity_class_generator');

src/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Configuration implements ConfigurationInterface
1919
/**
2020
* {@inheritdoc}
2121
*/
22-
public function getConfigTreeBuilder()
22+
public function getConfigTreeBuilder(): TreeBuilder
2323
{
2424
$treeBuilder = new TreeBuilder('maker');
2525
if (method_exists($treeBuilder, 'getRootNode')) {

src/DependencyInjection/MakerExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MakerExtension extends Extension
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
public function load(array $configs, ContainerBuilder $container)
37+
public function load(array $configs, ContainerBuilder $container): void
3838
{
3939
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
4040
$loader->load('services.xml');

src/Doctrine/BaseRelation.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,36 @@ abstract class BaseRelation
2626

2727
abstract public function isOwning(): bool;
2828

29-
public function getPropertyName()
29+
public function getPropertyName(): string
3030
{
3131
return $this->propertyName;
3232
}
3333

34-
public function setPropertyName($propertyName)
34+
public function setPropertyName(string $propertyName): self
3535
{
3636
$this->propertyName = $propertyName;
3737

3838
return $this;
3939
}
4040

41-
public function getTargetClassName()
41+
public function getTargetClassName(): string
4242
{
4343
return $this->targetClassName;
4444
}
4545

46-
public function setTargetClassName($targetClassName)
46+
public function setTargetClassName(string $targetClassName): self
4747
{
4848
$this->targetClassName = $targetClassName;
4949

5050
return $this;
5151
}
5252

53-
public function getTargetPropertyName()
53+
public function getTargetPropertyName(): ?string
5454
{
5555
return $this->targetPropertyName;
5656
}
5757

58-
public function setTargetPropertyName($targetPropertyName)
58+
public function setTargetPropertyName(?string $targetPropertyName): self
5959
{
6060
$this->targetPropertyName = $targetPropertyName;
6161

@@ -67,7 +67,7 @@ public function isSelfReferencing(): bool
6767
return $this->isSelfReferencing;
6868
}
6969

70-
public function setIsSelfReferencing(bool $isSelfReferencing)
70+
public function setIsSelfReferencing(bool $isSelfReferencing): self
7171
{
7272
$this->isSelfReferencing = $isSelfReferencing;
7373

@@ -79,7 +79,7 @@ public function getMapInverseRelation(): bool
7979
return $this->mapInverseRelation;
8080
}
8181

82-
public function setMapInverseRelation(bool $mapInverseRelation)
82+
public function setMapInverseRelation(bool $mapInverseRelation): self
8383
{
8484
$this->mapInverseRelation = $mapInverseRelation;
8585

@@ -91,7 +91,7 @@ public function shouldAvoidSetter(): bool
9191
return $this->avoidSetter;
9292
}
9393

94-
public function avoidSetter(bool $avoidSetter = true)
94+
public function avoidSetter(bool $avoidSetter = true): self
9595
{
9696
$this->avoidSetter = $avoidSetter;
9797

0 commit comments

Comments
 (0)