1 | <?php |
||
9 | class PolicyMakeCommand extends GeneratorCommand |
||
10 | { |
||
11 | /** |
||
12 | * The console command name. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $name = 'mbt:policy'; |
||
17 | |||
18 | /** |
||
19 | * The console command description. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $description = 'Create a new policy class'; |
||
24 | |||
25 | /** |
||
26 | * The type of class being generated. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $type = 'Policy'; |
||
31 | |||
32 | /** |
||
33 | * Build the class with the given name. |
||
34 | * |
||
35 | * @param string $name |
||
36 | * @return string |
||
37 | */ |
||
38 | protected function buildClass($name) |
||
48 | |||
49 | /** |
||
50 | * Replace the User model namespace. |
||
51 | * |
||
52 | * @param string $stub |
||
53 | * @return string |
||
54 | */ |
||
55 | protected function replaceUserNamespace($stub) |
||
69 | |||
70 | /** |
||
71 | * Replace the model for the given stub. |
||
72 | * |
||
73 | * @param string $stub |
||
74 | * @param string $model |
||
75 | * @return string |
||
76 | */ |
||
77 | protected function replaceModel($stub, $model) |
||
111 | |||
112 | /** |
||
113 | * Get the stub file for the generator. |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | protected function getStub() |
||
123 | |||
124 | /** |
||
125 | * Get the default namespace for the class. |
||
126 | * |
||
127 | * @param string $rootNamespace |
||
128 | * @return string |
||
129 | */ |
||
130 | protected function getDefaultNamespace($rootNamespace) |
||
134 | |||
135 | /** |
||
136 | * Get the console command arguments. |
||
137 | * |
||
138 | * @return array |
||
139 | */ |
||
140 | protected function getOptions() |
||
146 | } |
||
147 |
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: