Skip to content

Commit 5f7f2e1

Browse files
committed
add CodeGeneratorProvider
1 parent 8ac14b1 commit 5f7f2e1

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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\Templating;
11+
12+
class CodeGeneratorProvider implements ICodeGeneratorProvider
13+
{
14+
protected string $name;
15+
protected string $description;
16+
protected ICodeGenerator $generator;
17+
18+
public function __construct(string $name, string $description, ICodeGenerator $generator)
19+
{
20+
$this->name = $name;
21+
$this->description = $description;
22+
$this->generator = $generator;
23+
}
24+
25+
/**
26+
* Get the generator name
27+
*/
28+
public function getName(): string
29+
{
30+
return $this->name;
31+
}
32+
33+
/**
34+
* Get the generator description
35+
*/
36+
public function getDescription(): string
37+
{
38+
return $this->description;
39+
}
40+
41+
/**
42+
* Get the code generator
43+
*/
44+
public function getGenerator(): ICodeGenerator
45+
{
46+
return $this->generator;
47+
}
48+
}

0 commit comments

Comments
 (0)