1 | <?php |
||
15 | class Structure extends Directory |
||
16 | { |
||
17 | /** |
||
18 | * The parameter definition |
||
19 | * |
||
20 | * @var ParameterSet |
||
21 | **/ |
||
22 | private $parameterDefinition; |
||
23 | |||
24 | /** |
||
25 | * Constructor |
||
26 | * |
||
27 | * @return void |
||
|
|||
28 | **/ |
||
29 | public function __construct() |
||
38 | |||
39 | /** |
||
40 | * Add a file |
||
41 | * |
||
42 | * @param string $name |
||
43 | * @param FileContents|string $contents |
||
44 | * @param int $mode mode in octal 0XXX |
||
45 | * @return Structure |
||
46 | **/ |
||
47 | public function file($name, $contents = '', $mode = null) |
||
57 | |||
58 | /** |
||
59 | * Add a directory |
||
60 | * |
||
61 | * @param string $name |
||
62 | * @param int $mode mode in octal 0XXX |
||
63 | * @return Structure |
||
64 | **/ |
||
65 | public function directory($name, $mode = null) |
||
75 | |||
76 | /** |
||
77 | * Create a symlink |
||
78 | * |
||
79 | * @param string $from |
||
80 | * @param string $to |
||
81 | * @return Structure |
||
82 | **/ |
||
83 | public function link($from, $to) |
||
93 | |||
94 | /** |
||
95 | * Add a parameter |
||
96 | * |
||
97 | * @param string $name name of the parameter |
||
98 | * @param string $description (optional) human readable description |
||
99 | * @return Structure |
||
100 | **/ |
||
101 | public function parameter($name, $description = null) |
||
107 | |||
108 | /** |
||
109 | * Get the parameter definition |
||
110 | * |
||
111 | * @return ParameterSet |
||
112 | */ |
||
113 | public function getParameterDefinition() |
||
117 | |||
118 | /** |
||
119 | * Set the parameter definition |
||
120 | * |
||
121 | * @param ParameterSet $parameterDefinition |
||
122 | * @return Structure |
||
123 | */ |
||
124 | public function setParameterDefinition(ParameterSet $parameterDefinition) |
||
130 | |||
131 | /** |
||
132 | * Create (and add) a parent directory for a path |
||
133 | * |
||
134 | * @param string $name |
||
135 | * @return void |
||
136 | **/ |
||
137 | private function parentDirectory($name) |
||
184 | } |
||
185 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.