Skip to content

Commit 8720938

Browse files
committed
Added $PZ_PWD to get cwd instead of php code
1 parent 115b652 commit 8720938

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/PzSymfonyModule.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace ProjectZer0\PzSymfony;
66

7-
use LogicException;
87
use ProjectZer0\Pz\Config\PzModuleConfigurationInterface;
98
use ProjectZer0\Pz\Console\Command\ProcessCommand;
109
use ProjectZer0\Pz\Module\PzModule;
@@ -22,19 +21,12 @@
2221
*/
2322
class PzSymfonyModule extends PzModule
2423
{
25-
private ?string $cwd = null;
26-
2724
public function getCommands(): array
2825
{
2926
return [
30-
new class($this->getCWD()) extends ProcessCommand {
27+
new class() extends ProcessCommand {
3128
protected static $defaultName = 'symfony:console';
3229

33-
public function __construct(private string $cwd)
34-
{
35-
parent::__construct();
36-
}
37-
3830
protected function configure(): void
3931
{
4032
$this->setDescription('Dependency Management for PHP')
@@ -84,7 +76,6 @@ public function getProcess(
8476

8577
public function boot(ProjectZer0Toolkit $toolkit): void
8678
{
87-
$this->cwd = $toolkit->getCurrentDirectory();
8879
}
8980

9081
/**
@@ -118,13 +109,4 @@ public function getName(): string
118109
{
119110
return 'symnfony';
120111
}
121-
122-
private function getCWD(): string
123-
{
124-
if (null === $this->cwd) {
125-
throw new LogicException('PzModule was not initialized correctly');
126-
}
127-
128-
return $this->cwd;
129-
}
130112
}

0 commit comments

Comments
 (0)