Skip to content

Commit 428ae9f

Browse files
committed
add CommandRegistry
1 parent 781d9dc commit 428ae9f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/Commands/CommandRegistry.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
/**
4+
* @author Mohammed Moussaoui
5+
* @copyright Copyright (c) Mohammed Moussaoui. All rights reserved.
6+
* @license MIT License. For full license information see LICENSE file in the project root.
7+
* @link https://github.com/DevNet-Framework
8+
*/
9+
10+
namespace DevNet\Cli\Commands;
11+
12+
use DevNet\System\Command\ICommand;
13+
14+
class CommandRegistry extends AbstractRegistry
15+
{
16+
private static ?CommandRegistry $instance = null;
17+
18+
public static function getSingleton(): static
19+
{
20+
if (!static::$instance) {
21+
static::$instance = new CommandRegistry(ICommand::class);
22+
}
23+
24+
return static::$instance;
25+
}
26+
}

0 commit comments

Comments
 (0)