Skip to content

Commit 30ef40e

Browse files
committed
Require PHP8
Update SF libs to 5.4 Update internal libs Update to use PHP8 syntax and typed properties
1 parent bdc9c8a commit 30ef40e

File tree

113 files changed

+491
-1120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+491
-1120
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup PHP
1616
uses: shivammathur/setup-php@v2
1717
with:
18-
php-version: '7.4'
18+
php-version: '8.0'
1919
extensions: mbstring, intl, posix
2020
ini-values: memory_limit=256M, max_execution_time=0, phar.readonly=0
2121
tools: pecl

.idea/codeStyles/Project.xml

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php-test-framework.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.idea/php.xml

Lines changed: 38 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/project-manager.iml

Lines changed: 33 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
"description": "A CLI utility for helping manage a micro-services project",
55
"license": "MIT",
66
"require": {
7-
"php": ">=7.4",
7+
"php": "^8.0",
88
"ext-ctype": "*",
99
"ext-iconv": "*",
1010
"ext-json": "*",
1111
"pragmarx/ia-str": "~7.3",
12-
"somnambulist/collection": "~4.0.1",
13-
"symfony/config": "5.2.*",
14-
"symfony/console": "5.2.*",
15-
"symfony/dependency-injection": "5.2.*",
16-
"symfony/dotenv": "5.2.*",
17-
"symfony/finder": "5.2.*",
18-
"symfony/http-kernel": "5.2.*",
19-
"symfony/process": "5.2.*",
20-
"symfony/yaml": "5.2.*"
12+
"somnambulist/collection": "^5.2",
13+
"symfony/config": "5.4.*",
14+
"symfony/console": "5.4.*",
15+
"symfony/dependency-injection": "5.4.*",
16+
"symfony/dotenv": "5.4.*",
17+
"symfony/finder": "5.4.*",
18+
"symfony/http-kernel": "5.4.*",
19+
"symfony/process": "5.4.*",
20+
"symfony/yaml": "5.4.*"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "~9",
24-
"symfony/var-dumper": "5.2.*"
23+
"phpunit/phpunit": "~9.5",
24+
"symfony/var-dumper": "5.4.*"
2525
},
2626
"config": {
2727
"preferred-install": {

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and continue on. There is no special configuration needed in any project.
2222

2323
## Installation
2424

25-
Project Manager requires PHP 7.3+ to be installed and in your shell path.
25+
Project Manager requires PHP 8.0+ to be installed and in your shell path.
2626

2727
Grab the phar archive and copy it to `/usr/local/bin` or add it to your path.
2828
Symlink the phar to `spm` or a.n.other name. Be sure to verify the SHA checksum with

src/Application.php

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
*/
3333
class Application extends BaseApplication
3434
{
35-
private $kernel;
36-
private $commandsRegistered = false;
37-
private $registrationErrors = [];
35+
private KernelInterface $kernel;
36+
private bool $commandsRegistered = false;
37+
private array $registrationErrors = [];
3838

3939
public function __construct(KernelInterface $kernel, string $version)
4040
{
@@ -43,7 +43,7 @@ public function __construct(KernelInterface $kernel, string $version)
4343
parent::__construct('Somnambulist Project Manager', $version);
4444
}
4545

46-
public function getLongVersion()
46+
public function getLongVersion(): string
4747
{
4848
return trim(parent::getLongVersion()) . sprintf(' (project: <comment>%s</>)', $_SERVER['SOMNAMBULIST_ACTIVE_PROJECT'] ?: '-');
4949
}
@@ -53,15 +53,12 @@ public function getLongVersion()
5353
*
5454
* @return KernelInterface A KernelInterface instance
5555
*/
56-
public function getKernel()
56+
public function getKernel(): KernelInterface
5757
{
5858
return $this->kernel;
5959
}
6060

61-
/**
62-
* {@inheritdoc}
63-
*/
64-
public function reset()
61+
public function reset(): void
6562
{
6663

6764
}
@@ -75,7 +72,7 @@ public function reset()
7572
* @return int 0 if everything went fine, or an error code
7673
* @throws Throwable
7774
*/
78-
public function doRun(InputInterface $input, OutputInterface $output)
75+
public function doRun(InputInterface $input, OutputInterface $output): int
7976
{
8077
$this->registerCommands();
8178

@@ -88,10 +85,7 @@ public function doRun(InputInterface $input, OutputInterface $output)
8885
return parent::doRun($input, $output);
8986
}
9087

91-
/**
92-
* {@inheritdoc}
93-
*/
94-
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
88+
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output): int
9589
{
9690
$helper = new ConsoleHelper($input, $output);
9791

@@ -132,20 +126,14 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
132126
return $returnCode;
133127
}
134128

135-
/**
136-
* {@inheritdoc}
137-
*/
138-
public function find($name)
129+
public function find($name): Command
139130
{
140131
$this->registerCommands();
141132

142133
return parent::find($name);
143134
}
144135

145-
/**
146-
* {@inheritdoc}
147-
*/
148-
public function get($name)
136+
public function get($name): Command
149137
{
150138
$this->registerCommands();
151139

@@ -158,24 +146,21 @@ public function get($name)
158146
return $command;
159147
}
160148

161-
/**
162-
* {@inheritdoc}
163-
*/
164-
public function all($namespace = null)
149+
public function all($namespace = null): array
165150
{
166151
$this->registerCommands();
167152

168153
return parent::all($namespace);
169154
}
170155

171-
public function add(Command $command)
156+
public function add(Command $command): Command
172157
{
173158
$this->registerCommands();
174159

175160
return parent::add($command);
176161
}
177162

178-
protected function registerCommands()
163+
protected function registerCommands(): void
179164
{
180165
if ($this->commandsRegistered) {
181166
return;
@@ -205,7 +190,7 @@ protected function registerCommands()
205190
}
206191
}
207192

208-
private function renderRegistrationErrors(InputInterface $input, OutputInterface $output)
193+
private function renderRegistrationErrors(InputInterface $input, OutputInterface $output): void
209194
{
210195
if ($output instanceof ConsoleOutputInterface) {
211196
$output = $output->getErrorOutput();

src/Commands/AbstractCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
*/
1515
abstract class AbstractCommand extends Command
1616
{
17-
1817
use IsRunningInDebugMode;
1918
use UseConsoleHelper;
20-
2119
}

src/Commands/Behaviours/CanUpdateGitRemoteRepository.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
trait CanUpdateGitRemoteRepository
1717
{
18-
1918
protected function changeGitOrigin(Project $project, $cwd, $repo): int
2019
{
2120
$com = 'addRemote';

0 commit comments

Comments
 (0)