1 | <?php |
||
14 | trait Installable |
||
15 | { |
||
16 | /** |
||
17 | * Install files from array. |
||
18 | * |
||
19 | * @param $files |
||
20 | */ |
||
21 | private function install($files) |
||
36 | |||
37 | /** |
||
38 | * @param $fileName |
||
39 | * @param string $prompt |
||
40 | * |
||
41 | * @return bool |
||
42 | */ |
||
43 | protected function confirmOverwrite($fileName, $prompt = '') |
||
51 | |||
52 | /** |
||
53 | * Create the directory to house the published files if needed. |
||
54 | * |
||
55 | * @param string $directory |
||
56 | * |
||
57 | * @return void |
||
58 | */ |
||
59 | protected function createParentDirectory($directory) |
||
65 | |||
66 | /** |
||
67 | * Publish the file to the given path. |
||
68 | * |
||
69 | * @param string $from |
||
70 | * @param string $to |
||
71 | * |
||
72 | * @return void |
||
73 | */ |
||
74 | protected function publishFile($from, $to) |
||
80 | |||
81 | /** |
||
82 | * Publish the directory to the given directory. |
||
83 | * |
||
84 | * @param string $from |
||
85 | * @param string $to |
||
86 | * |
||
87 | * @return void |
||
88 | */ |
||
89 | protected function publishDirectory($from, $to) |
||
102 | |||
103 | /** |
||
104 | * Write a status message to the console. |
||
105 | * |
||
106 | * @param string $from |
||
107 | * @param string $to |
||
108 | * @param string $type |
||
109 | * |
||
110 | * @return void |
||
111 | */ |
||
112 | protected function status($from, $to, $type) |
||
118 | |||
119 | } |
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: