1 | <?php |
||
10 | class CommandCreator |
||
11 | { |
||
12 | use Filesystem; |
||
13 | |||
14 | /** |
||
15 | * Yarak config. |
||
16 | * |
||
17 | * @var Config |
||
18 | */ |
||
19 | protected $config; |
||
20 | |||
21 | /** |
||
22 | * Output strategy. |
||
23 | * |
||
24 | * @var Output |
||
25 | */ |
||
26 | protected $output; |
||
27 | |||
28 | /** |
||
29 | * Construct. |
||
30 | * |
||
31 | * @param Config $config |
||
32 | * @param Output $output |
||
33 | */ |
||
34 | public function __construct(Config $config, Output $output) |
||
39 | |||
40 | /** |
||
41 | * Create a new command with given name. |
||
42 | * |
||
43 | * @param string $name |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function create($name) |
||
66 | |||
67 | /** |
||
68 | * Get the stub file and insert name. |
||
69 | * |
||
70 | * @param string $name |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | protected function getStub($name) |
||
82 | |||
83 | /** |
||
84 | * Resolve the command namespace. |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | protected function resolveNamespace() |
||
96 | |||
97 | /** |
||
98 | * Set the namespace in the command stub. |
||
99 | * |
||
100 | * @param string $stub |
||
101 | * @param string $namespace |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | protected function setNamespace($stub, $namespace = null) |
||
117 | } |
||
118 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: