Skip to content

Commit 33f4181

Browse files
committed
Merge branch 'release/0.8.13'
2 parents 5c4bc0f + ea1b8b9 commit 33f4181

7 files changed

Lines changed: 29 additions & 22 deletions

File tree

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"strategy": "semver",
33
"major": 0,
44
"minor": 8,
5-
"patch": 12,
5+
"patch": 13,
66
"build": 0
77
}

src/Cli/Application.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Neuron\Cli\Console\Input;
88
use Neuron\Cli\Console\Output;
99
use Neuron\Cli\Loader\ComponentLoader;
10+
use Neuron\Core\Registry\RegistryKeys;
1011
use Neuron\Data\Settings\Source\ISettingSource;
1112
use Neuron\Log\Log;
1213

@@ -131,8 +132,8 @@ protected function onStart(): bool
131132
protected function executeCommand(): void
132133
{
133134
// Store the application instance in the registry for commands to access
134-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $this );
135-
135+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $this );
136+
136137
// Check if command exists
137138
if( !$this->commandRegistry->has( $this->commandName ) )
138139
{
@@ -174,7 +175,7 @@ protected function executeCommand(): void
174175
$exitCode = $command->execute();
175176

176177
// Store exit code in registry for bin/neuron to retrieve
177-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.exit_code', $exitCode );
178+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_EXIT_CODE_LEGACY, $exitCode );
178179
}
179180
catch( \Exception $e )
180181
{
@@ -186,7 +187,7 @@ protected function executeCommand(): void
186187
}
187188

188189
// Store error exit code
189-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.exit_code', 1 );
190+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_EXIT_CODE_LEGACY, 1 );
190191
}
191192
}
192193

@@ -309,8 +310,8 @@ private function showHelp(): void
309310
private function showCommandHelp( string $commandName ): void
310311
{
311312
// Store the application instance in the registry for commands to access
312-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $this );
313-
313+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $this );
314+
314315
if( !$this->commandRegistry->has( $commandName ) )
315316
{
316317
$this->output->error( "Command '{$commandName}' not found" );
@@ -370,6 +371,6 @@ public function getCurrentCommand(): ?Commands\Command
370371
*/
371372
public function getExitCode(): int
372373
{
373-
return \Neuron\Patterns\Registry::getInstance()->get( 'cli.exit_code' ) ?? 0;
374+
return \Neuron\Patterns\Registry::getInstance()->get( RegistryKeys::CLI_EXIT_CODE_LEGACY ) ?? 0;
374375
}
375376
}

src/Cli/Commands/Core/ComponentListCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Neuron\Cli\Commands\Command;
66
use Neuron\Cli\Commands\Registry;
7+
use Neuron\Core\Registry\RegistryKeys;
78

89
/**
910
* Lists all available commands organized by component
@@ -41,7 +42,7 @@ public function configure(): void
4142
public function execute(): int
4243
{
4344
// Get the application from registry
44-
$app = \Neuron\Patterns\Registry::getInstance()->get( 'cli.application' );
45+
$app = \Neuron\Patterns\Registry::getInstance()->get( RegistryKeys::CLI_APPLICATION_LEGACY );
4546

4647
if( !$app )
4748
{

src/Cli/Commands/Core/HelpCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Neuron\Cli\Commands\Core;
44

55
use Neuron\Cli\Commands\Command;
6+
use Neuron\Core\Registry\RegistryKeys;
67
use Neuron\Patterns\Registry;
78

89
/**
@@ -49,7 +50,7 @@ public function execute(): int
4950
}
5051

5152
// Get the application from registry
52-
$app = Registry::getInstance()->get( 'cli.application' );
53+
$app = Registry::getInstance()->get( RegistryKeys::CLI_APPLICATION_LEGACY );
5354

5455
if( !$app )
5556
{

tests/Cli/Commands/Core/ComponentListCommandTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Neuron\Cli\Commands\Registry;
77
use Neuron\Cli\Console\Input;
88
use Neuron\Cli\Console\Output;
9+
use Neuron\Core\Registry\RegistryKeys;
910
use PHPUnit\Framework\TestCase;
1011

1112
class ComponentListCommandTest extends TestCase
@@ -73,7 +74,7 @@ public function testExecuteFormattedList(): void
7374
$this->registry->register( 'test:command', 'Tests\Cli\Commands\Core\MockTestCommand' );
7475
$this->registry->register( 'help', 'Neuron\Cli\Commands\Core\HelpCommand' );
7576

76-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $app );
77+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $app );
7778

7879
$input = new Input( [] );
7980
$input->parse( $this->command );
@@ -95,7 +96,7 @@ public function testExecuteRawList(): void
9596
$this->registry->register( 'test:command', 'Tests\Cli\Commands\Core\MockTestCommand' );
9697
$this->registry->register( 'help', 'Neuron\Cli\Commands\Core\HelpCommand' );
9798

98-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $app );
99+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $app );
99100

100101
$input = new Input( ['--raw'] );
101102
$input->parse( $this->command );
@@ -120,7 +121,7 @@ public function testExecuteWithNamespaceFilter(): void
120121
$this->registry->register( 'help', 'Neuron\Cli\Commands\Core\HelpCommand' );
121122
$this->registry->register( 'other:command', 'Tests\Cli\Commands\Core\MockTestCommand' );
122123

123-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $app );
124+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $app );
124125

125126
$input = new Input( ['--namespace=test'] );
126127
$input->parse( $this->command );
@@ -142,7 +143,7 @@ public function testExecuteWithEmptyRegistry(): void
142143
$app = $this->createMockApplication();
143144
// Don't register any commands
144145

145-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $app );
146+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $app );
146147

147148
$input = new Input( [] );
148149
$input->parse( $this->command );
@@ -161,7 +162,7 @@ public function testExecuteWithNamespaceFilterNoMatches(): void
161162
$app = $this->createMockApplication();
162163
$this->registry->register( 'test:command', 'Tests\Cli\Commands\Core\MockTestCommand' );
163164

164-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $app );
165+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $app );
165166

166167
$input = new Input( ['--namespace=nonexistent'] );
167168
$input->parse( $this->command );
@@ -183,7 +184,7 @@ public function testRawListWithNamespaceFilter(): void
183184
$this->registry->register( 'test:command2', 'Tests\Cli\Commands\Core\MockTestCommand' );
184185
$this->registry->register( 'other:command', 'Tests\Cli\Commands\Core\MockTestCommand' );
185186

186-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $app );
187+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $app );
187188

188189
$input = new Input( ['--raw', '--namespace=test'] );
189190
$input->parse( $this->command );
@@ -206,7 +207,7 @@ public function testFormattedListGroupsAndSortsNamespaces(): void
206207
$this->registry->register( 'zebra:test', 'Tests\Cli\Commands\Core\MockTestCommand' );
207208
$this->registry->register( 'alpha:test', 'Tests\Cli\Commands\Core\MockTestCommand' );
208209

209-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $app );
210+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $app );
210211

211212
$input = new Input( [] );
212213
$input->parse( $this->command );

tests/Cli/Commands/Core/HelpCommandTest.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Neuron\Cli\Commands\Registry;
77
use Neuron\Cli\Console\Input;
88
use Neuron\Cli\Console\Output;
9+
use Neuron\Core\Registry\RegistryKeys;
910
use PHPUnit\Framework\TestCase;
1011

1112
class HelpCommandTest extends TestCase
@@ -91,7 +92,7 @@ public function testGeneralHelpContainsExamples(): void
9192
public function testExecuteWithoutApplicationInRegistry(): void
9293
{
9394
// Clear registry
94-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', null );
95+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, null );
9596

9697
$input = new Input( ['test:command'] );
9798
$input->parse( $this->command );
@@ -111,7 +112,7 @@ public function testExecuteWithNonExistentCommand(): void
111112
$mockApp = $this->createMock( \Neuron\Cli\Application::class );
112113
$mockApp->method( 'has' )->willReturn( false );
113114

114-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $mockApp );
115+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $mockApp );
115116

116117
$input = new Input( ['nonexistent:command'] );
117118
$input->parse( $this->command );
@@ -140,7 +141,7 @@ public function testExecuteWithNonExistentCommandClass(): void
140141
$mockApp->method( 'has' )->willReturn( true );
141142
$mockApp->method( 'getRegistry' )->willReturn( $mockRegistry );
142143

143-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', $mockApp );
144+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, $mockApp );
144145

145146
$input = new Input( ['test:command'] );
146147
$input->parse( $this->command );
@@ -154,12 +155,12 @@ public function testExecuteWithNonExistentCommandClass(): void
154155
$this->assertStringContainsString( 'Command class not found', $output );
155156

156157
// Cleanup
157-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', null );
158+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, null );
158159
}
159160

160161
protected function tearDown(): void
161162
{
162163
// Cleanup registry after each test
163-
\Neuron\Patterns\Registry::getInstance()->set( 'cli.application', null );
164+
\Neuron\Patterns\Registry::getInstance()->set( RegistryKeys::CLI_APPLICATION_LEGACY, null );
164165
}
165166
}

versionlog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.8.13 2026-01-13
2+
13
## 0.8.12 2026-01-12
24

35
## 0.8.11 2026-01-06

0 commit comments

Comments
 (0)