Skip to content

Commit 8489b33

Browse files
committed
add bundle return types
1 parent ae20d0e commit 8489b33

5 files changed

+10
-12
lines changed

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/EventRegistry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function getAllActiveEvents(): array
123123
/**
124124
* Attempts to get the event class for a given event.
125125
*/
126-
public function getEventClassName(string $event)
126+
public function getEventClassName(string $event): ?string
127127
{
128128
// if the event is already a class name, use it
129129
if (class_exists($event)) {
@@ -169,7 +169,7 @@ public function getEventClassName(string $event)
169169
return null;
170170
}
171171

172-
public function listActiveEvents(array $events)
172+
public function listActiveEvents(array $events): array
173173
{
174174
foreach ($events as $key => $event) {
175175
$events[$key] = sprintf('%s (<fg=yellow>%s</>)', $event, self::$eventsMap[$event]);

src/FileManager.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(
4949
$this->twigDefaultPath = $twigDefaultPath ? rtrim($this->relativizePath($twigDefaultPath), '/') : null;
5050
}
5151

52-
public function setIO(SymfonyStyle $io)
52+
public function setIO(SymfonyStyle $io): void
5353
{
5454
$this->io = $io;
5555
}
@@ -63,7 +63,7 @@ public function parseTemplate(string $templatePath, array $parameters): string
6363
return ob_get_clean();
6464
}
6565

66-
public function dumpFile(string $filename, string $content)
66+
public function dumpFile(string $filename, string $content): void
6767
{
6868
$absolutePath = $this->absolutizePath($filename);
6969
$newFile = !$this->fileExists($filename);
@@ -155,11 +155,9 @@ public function absolutizePath($path): string
155155
}
156156

157157
/**
158-
* @return string|null
159-
*
160158
* @throws \Exception
161159
*/
162-
public function getRelativePathForFutureClass(string $className)
160+
public function getRelativePathForFutureClass(string $className): ?string
163161
{
164162
$path = $this->autoloaderUtil->getPathForFutureClass($className);
165163

src/InputConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class InputConfiguration
1919
* Call in MakerInterface::configureCommand() to disable the automatic interactive
2020
* prompt for an argument.
2121
*/
22-
public function setArgumentAsNonInteractive(string $argumentName)
22+
public function setArgumentAsNonInteractive(string $argumentName): void
2323
{
2424
$this->nonInteractiveArguments[] = $argumentName;
2525
}

0 commit comments

Comments
 (0)