Skip to content

Commit ad3f07a

Browse files
Bump to PHP 8.1 and add missing return types
1 parent 5c569ce commit ad3f07a

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.1",
13+
"php": ">=8.1",
1414
"composer-plugin-api": "^1.0|^2.0"
1515
},
1616
"autoload": {
@@ -20,7 +20,7 @@
2020
},
2121
"extra": {
2222
"branch-alias": {
23-
"dev-main": "1.3-dev"
23+
"dev-main": "1.4-dev"
2424
},
2525
"class": "Symfony\\Thanks\\Thanks"
2626
}

src/Command/FundCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FundCommand extends BaseCommand
2626
private $love = '💖 ';
2727
private $cash = '💵 ';
2828

29-
protected function configure()
29+
protected function configure(): void
3030
{
3131
if ('Hyper' === getenv('TERM_PROGRAM')) {
3232
$this->star = '';
@@ -41,7 +41,7 @@ protected function configure()
4141
;
4242
}
4343

44-
protected function execute(InputInterface $input, OutputInterface $output)
44+
protected function execute(InputInterface $input, OutputInterface $output): int
4545
{
4646
$composer = $this->getComposer();
4747
$gitHub = new GitHubClient($composer, $this->getIO());

src/Command/ThanksCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ThanksCommand extends BaseCommand
2626
private $love = '💖 ';
2727
private $cash = '💵 ';
2828

29-
protected function configure()
29+
protected function configure(): void
3030
{
3131
if ('Hyper' === getenv('TERM_PROGRAM')) {
3232
$this->star = '';
@@ -44,7 +44,7 @@ protected function configure()
4444
;
4545
}
4646

47-
protected function execute(InputInterface $input, OutputInterface $output)
47+
protected function execute(InputInterface $input, OutputInterface $output): int
4848
{
4949
$composer = $this->getComposer();
5050
$gitHub = new GitHubClient($composer, $this->getIO());

src/GitHubClient.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function __construct(Composer $composer, IOInterface $io)
106106
}
107107
}
108108

109-
public function getRepositories(?array &$failures = null, $withFundingLinks = false)
109+
public function getRepositories(?array &$failures = null, $withFundingLinks = false): array
110110
{
111111
$repo = $this->composer->getRepositoryManager()->getLocalRepository();
112112

@@ -179,7 +179,7 @@ public function getRepositories(?array &$failures = null, $withFundingLinks = fa
179179
return $repos;
180180
}
181181

182-
public function call($graphql, array &$failures = [])
182+
public function call($graphql, array &$failures = []): mixed
183183
{
184184
$options = [
185185
'http' => [
@@ -218,7 +218,7 @@ public function call($graphql, array &$failures = [])
218218
return isset($result['data']) ? $result['data'] : [];
219219
}
220220

221-
private function getDirectlyRequiredPackageNames()
221+
private function getDirectlyRequiredPackageNames(): array
222222
{
223223
$file = new JsonFile(Factory::getComposerFile(), null, $this->io);
224224

src/Thanks.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Thanks implements EventSubscriberInterface, PluginInterface
2929
private $io;
3030
private $displayReminder = 0;
3131

32-
public function activate(Composer $composer, IOInterface $io)
32+
public function activate(Composer $composer, IOInterface $io): void
3333
{
3434
$this->io = $io;
3535

@@ -65,14 +65,14 @@ public function activate(Composer $composer, IOInterface $io)
6565
}
6666
}
6767

68-
public function enableReminder()
68+
public function enableReminder(): void
6969
{
7070
if (1 === $this->displayReminder) {
7171
$this->displayReminder = version_compare('1.1.0', PluginInterface::PLUGIN_API_VERSION, '<=') ? 2 : 0;
7272
}
7373
}
7474

75-
public function displayReminder(ScriptEvent $event)
75+
public function displayReminder(ScriptEvent $event): void
7676
{
7777
if (2 !== $this->displayReminder) {
7878
return;
@@ -108,7 +108,7 @@ public function displayReminder(ScriptEvent $event)
108108
$this->io->writeError('');
109109
}
110110

111-
public static function getSubscribedEvents()
111+
public static function getSubscribedEvents(): array
112112
{
113113
return [
114114
PackageEvents::POST_PACKAGE_UPDATE => 'enableReminder',
@@ -119,14 +119,14 @@ public static function getSubscribedEvents()
119119
/**
120120
* {@inheritdoc}
121121
*/
122-
public function deactivate(Composer $composer, IOInterface $io)
122+
public function deactivate(Composer $composer, IOInterface $io): void
123123
{
124124
}
125125

126126
/**
127127
* {@inheritdoc}
128128
*/
129-
public function uninstall(Composer $composer, IOInterface $io)
129+
public function uninstall(Composer $composer, IOInterface $io): void
130130
{
131131
}
132132
}

0 commit comments

Comments
 (0)