1 | <?php |
||
9 | class SyncerCommand |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * Creates a new instance of the SyncerCommand. |
||
14 | * @param FileCollector $fileCollector File Collector. |
||
15 | * @param EnvironmentFinder $envFinder Environment Variable Filder. |
||
16 | * @param TableBuilder $tableBuilder Table Builder. |
||
17 | */ |
||
18 | public function __construct(FileCollector $fileCollector, EnvironmentFinder $envFinder, TableBuilder $tableBuilder) |
||
24 | |||
25 | /** |
||
26 | * Runs the command. |
||
27 | * Supressing this for now. |
||
28 | * @SuppressWarnings(PHPMD.NPathComplexity) |
||
29 | * @param array $arguments Command line arguments. |
||
30 | * @return void |
||
31 | */ |
||
32 | public function handle(array $arguments) |
||
42 | |||
43 | /** |
||
44 | * Gets a list of the environment variables defined in the |
||
45 | * source code, .env and .env.example file. |
||
46 | * @return array |
||
47 | */ |
||
48 | protected function getEnvironmentVariables() |
||
62 | |||
63 | /** |
||
64 | * Takes the list of environment variables defined and creates |
||
65 | * a results array showing each variable and where it is or is not |
||
66 | * defined. |
||
67 | * @param array $envData Environment Variable Data. |
||
68 | * @return array |
||
69 | */ |
||
70 | protected function getResults(array $envData) |
||
85 | |||
86 | /** |
||
87 | * Looks through all the current env variables from all |
||
88 | * sources and makes a master list of all of them. |
||
89 | * @param array $currentEnvs Current Env Variables. |
||
90 | * @return array |
||
91 | */ |
||
92 | protected function mergeEnvs(array $currentEnvs) |
||
100 | |||
101 | /** |
||
102 | * Collects the command line arguments. |
||
103 | * @param array $arguments Command line arguments. |
||
104 | * @return void |
||
105 | */ |
||
106 | protected function handleArguments(array $arguments) |
||
115 | } |
||
116 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: