1 | <?php |
||
7 | class HeaderCompilerFactory |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | private $environment; |
||
13 | |||
14 | /** |
||
15 | * @var HeaderCompiler[] |
||
16 | */ |
||
17 | private $headerCompilers = []; |
||
18 | |||
19 | /** |
||
20 | * HeaderCompilerFactory constructor. |
||
21 | * |
||
22 | * @param string $environment |
||
23 | */ |
||
24 | function __construct(string $environment) { |
||
27 | |||
28 | /** |
||
29 | * @param string $environment |
||
30 | * |
||
31 | * @return HeaderCompilerFactory |
||
32 | */ |
||
33 | public function setEnvironment(string $environment) : HeaderCompilerFactory { |
||
38 | |||
39 | /** |
||
40 | * @param string $environment |
||
41 | * @param HeaderCompiler $headerCompiler |
||
42 | * |
||
43 | * @return HeaderCompilerFactory |
||
44 | */ |
||
45 | public function addHeaderCompiler(string $environment, HeaderCompiler $headerCompiler) : HeaderCompilerFactory { |
||
50 | |||
51 | /** |
||
52 | * @return HeaderCompiler|null |
||
53 | */ |
||
54 | public function getHeaderCompilerByEnvironment() : ?HeaderCompiler { |
||
57 | } |
||
58 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.