Skip to content

Commit 8c7347d

Browse files
author
Greg Bowler
committed
PHP 8 update
1 parent 759137d commit 8c7347d

File tree

7 files changed

+48
-66
lines changed

7 files changed

+48
-66
lines changed

bin/gt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<?php
33
namespace Gt\Installer;
44

5+
use Gt\Cli\Application;
56
use Gt\Cli\Argument\ArgumentList;
67
use Gt\Installer\Command\BuildCommand;
78
use Gt\Installer\Command\CreateCommand;
@@ -18,7 +19,7 @@ foreach([ __DIR__ . "/../../..", __DIR__ . "/../vendor" ] as $vendor) {
1819
}
1920
}
2021

21-
$app = new \Gt\Cli\Application(
22+
$app = new Application(
2223
"PHP.Gt Command Line Interface",
2324
new ArgumentList(...$argv),
2425
new CreateCommand(),
@@ -28,4 +29,4 @@ $app = new \Gt\Cli\Application(
2829
new ServeCommand(),
2930
new MigrateCommand()
3031
);
31-
$app->run();
32+
$app->run();

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
],
77

88
"require": {
9-
"php": ">=7.4",
9+
"php": ">=8.0",
1010
"phpgt/cli": "*",
1111
"phpgt/daemon": "*",
1212
"phpgt/cron": "*",

composer.lock

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

src/Command/AbstractWebEngineCommand.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
namespace Gt\Installer\Command;
33

4-
use Gt\Cli\Argument\Argument;
54
use Gt\Cli\Argument\ArgumentValueList;
65
use Gt\Cli\Command\Command;
76
use Gt\Cli\Stream;
@@ -13,25 +12,6 @@ public function executeScript(
1312
ArgumentValueList $arguments = null,
1413
array...$scriptsToRun
1514
):void {
16-
$stringArgumentArray = [];
17-
//
18-
// foreach($arguments as $arg) {
19-
// $key = $arg->getKey();
20-
//
21-
// if($key !== Argument::USER_DATA) {
22-
// $stringArgumentArray .= "--";
23-
// $stringArgumentArray .= $key;
24-
// }
25-
//
26-
// $value = $arg->get();
27-
// if(!empty($value)) {
28-
// $stringArgumentArray .= " ";
29-
// $stringArgumentArray .= $value;
30-
// }
31-
// }
32-
33-
// var_dump($arguments);die();
34-
3515
$processPool = new Pool();
3616

3717
foreach($scriptsToRun as $scriptParts) {
@@ -74,4 +54,4 @@ public function executeScript(
7454
}
7555
while($processPool->numRunning() > 0);
7656
}
77-
}
57+
}

src/Command/CreateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Gt\Cli\Stream;
99
use Gt\Daemon\Process;
1010

11-
class CreateCommand extends Command {
11+
class CreateCommand extends AbstractWebEngineCommand {
1212
public function run(ArgumentValueList $arguments = null):void {
1313
$cwd = getcwd();
1414
$appDir = implode(DIRECTORY_SEPARATOR, [
@@ -84,4 +84,4 @@ public function getOptionalParameterList():array {
8484
public function getRequiredParameterList():array {
8585
return [];
8686
}
87-
}
87+
}

src/Command/CronCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
namespace Gt\Installer\Command;
33

44
use Gt\Cli\Argument\ArgumentValueList;
5-
use Gt\Cli\Command\Command;
65
use Gt\Cli\Parameter\NamedParameter;
76
use Gt\Cli\Parameter\Parameter;
8-
use Gt\Cli\Stream;
97

108
class CronCommand extends AbstractWebEngineCommand {
119
public function run(ArgumentValueList $arguments = null):void {
@@ -44,4 +42,4 @@ public function getOptionalParameterList():array {
4442
$baseCommand = new \Gt\Cron\Command\RunCommand();
4543
return $baseCommand->getOptionalParameterList();
4644
}
47-
}
45+
}

src/Command/ServeCommand.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<?php
2-
32
namespace Gt\Installer\Command;
43

54
use Gt\Cli\Argument\ArgumentValueList;
6-
use Gt\Cli\Command\Command;
75
use Gt\Cli\Parameter\NamedParameter;
86
use Gt\Cli\Parameter\Parameter;
9-
use Gt\Cli\Stream;
10-
use Gt\Daemon\Process;
7+
use Gt\Server\Command\StartCommand;
118

129
class ServeCommand extends AbstractWebEngineCommand {
1310
public function run(ArgumentValueList $arguments = null):void {
@@ -19,31 +16,31 @@ public function getName():string {
1916
}
2017

2118
public function getDescription():string {
22-
$baseCommand = new \Gt\Server\Command\StartCommand();
19+
$baseCommand = new StartCommand();
2320
return $baseCommand->getDescription();
2421
}
2522

2623
/** @return NamedParameter[] */
2724
public function getRequiredNamedParameterList():array {
28-
$baseCommand = new \Gt\Server\Command\StartCommand();
25+
$baseCommand = new StartCommand();
2926
return $baseCommand->getRequiredNamedParameterList();
3027
}
3128

3229
/** @return NamedParameter[] */
3330
public function getOptionalNamedParameterList():array {
34-
$baseCommand = new \Gt\Server\Command\StartCommand();
31+
$baseCommand = new StartCommand();
3532
return $baseCommand->getOptionalNamedParameterList();
3633
}
3734

3835
/** @return Parameter[] */
3936
public function getRequiredParameterList():array {
40-
$baseCommand = new \Gt\Server\Command\StartCommand();
37+
$baseCommand = new StartCommand();
4138
return $baseCommand->getRequiredParameterList();
4239
}
4340

4441
/** @return Parameter[] */
4542
public function getOptionalParameterList():array {
46-
$baseCommand = new \Gt\Server\Command\StartCommand();
43+
$baseCommand = new StartCommand();
4744
return $baseCommand->getOptionalParameterList();
4845
}
49-
}
46+
}

0 commit comments

Comments
 (0)