1 | <?php |
||
38 | class RoboFile extends AbstractRoboFile |
||
|
|||
39 | { |
||
40 | |||
41 | /** |
||
42 | * Configuration key for the directories. |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | const DIRS = 'dirs'; |
||
47 | |||
48 | /** |
||
49 | * Configuration key for the deploy directory. |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | const DEPLOY = 'deploy'; |
||
54 | |||
55 | /** |
||
56 | * Configuration key for the docker configuration. |
||
57 | * |
||
58 | * @var string |
||
59 | */ |
||
60 | const DOCKER = 'docker'; |
||
61 | |||
62 | /** |
||
63 | * Configuration key for the docker target container name. |
||
64 | * |
||
65 | * @var string |
||
66 | */ |
||
67 | const TARGET_CONTAINER = 'target-container'; |
||
68 | |||
69 | /** |
||
70 | * Returns the deploy directory. |
||
71 | * |
||
72 | * @return string The directory to deploy the sources to |
||
73 | */ |
||
74 | protected function getDeployDir() |
||
78 | |||
79 | /** |
||
80 | * Returns the name of the docker target container. |
||
81 | * |
||
82 | * @return string The docker target container |
||
83 | */ |
||
84 | protected function getTargetContainer() |
||
88 | |||
89 | /** |
||
90 | * Run's the composer install command. |
||
91 | * |
||
92 | * @return void |
||
93 | */ |
||
94 | public function composerInstall() |
||
102 | |||
103 | /** |
||
104 | * Run's the composer update command. |
||
105 | * |
||
106 | * @return void |
||
107 | */ |
||
108 | public function composerUpdate() |
||
116 | |||
117 | /** |
||
118 | * Clean up the environment for a new build. |
||
119 | * |
||
120 | * @return void |
||
121 | */ |
||
122 | public function clean() |
||
126 | |||
127 | /** |
||
128 | * Prepare's the environment for a new build. |
||
129 | * |
||
130 | * @return void |
||
131 | */ |
||
132 | public function prepare() |
||
139 | |||
140 | /** |
||
141 | * Run's the PHPMD. |
||
142 | * |
||
143 | * @return void |
||
144 | */ |
||
145 | public function runMd() |
||
158 | |||
159 | /** |
||
160 | * Run's the PHPCPD. |
||
161 | * |
||
162 | * @return void |
||
163 | */ |
||
164 | public function runCpd() |
||
177 | |||
178 | /** |
||
179 | * Run's the PHPCodeSniffer. |
||
180 | * |
||
181 | * @return void |
||
182 | */ |
||
183 | public function runCs() |
||
196 | |||
197 | /** |
||
198 | * Run's the PHPUnit tests. |
||
199 | * |
||
200 | * @return void |
||
201 | */ |
||
202 | public function runTests() |
||
203 | { |
||
204 | |||
205 | // run PHPUnit |
||
206 | $this->taskPHPUnit(sprintf('%s/bin/phpunit', $this->getVendorDir())) |
||
207 | ->configFile('phpunit.xml') |
||
208 | ->run(); |
||
209 | } |
||
210 | |||
211 | /** |
||
212 | * Deploy's the extension to it's target directory. |
||
213 | * |
||
214 | * @return void |
||
215 | */ |
||
216 | public function deploy() |
||
220 | |||
221 | /** |
||
222 | * Deploy's the extension to it's target directory in the specified docker container. |
||
223 | * |
||
224 | * @return void |
||
225 | */ |
||
226 | public function deployDocker() |
||
236 | |||
237 | /** |
||
238 | * The complete build process. |
||
239 | * |
||
240 | * @return void |
||
241 | */ |
||
242 | public function build() |
||
251 | } |
||
252 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.