1 | <?php |
||
35 | class RoboFile extends AbstractRoboFile |
||
|
|||
36 | { |
||
37 | |||
38 | /** |
||
39 | * Run's the composer install command. |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public function composerInstall() |
||
44 | { |
||
45 | // optimize autoloader with custom path |
||
46 | $this->taskComposerInstall() |
||
47 | ->preferDist() |
||
48 | ->optimizeAutoloader() |
||
49 | ->run(); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Run's the composer update command. |
||
54 | * |
||
55 | * @return void |
||
56 | */ |
||
57 | public function composerUpdate() |
||
58 | { |
||
59 | // optimize autoloader with custom path |
||
60 | $this->taskComposerUpdate() |
||
61 | ->preferDist() |
||
62 | ->optimizeAutoloader() |
||
63 | ->run(); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * Clean up the environment for a new build. |
||
68 | * |
||
69 | * @return void |
||
70 | */ |
||
71 | public function clean() |
||
72 | { |
||
73 | $this->taskDeleteDir($this->getTargetDir())->run(); |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * Prepare's the environment for a new build. |
||
78 | * |
||
79 | * @return void |
||
80 | */ |
||
81 | public function prepare() |
||
82 | { |
||
83 | $this->taskFileSystemStack() |
||
84 | ->mkdir($this->getTargetDir()) |
||
85 | ->mkdir($this->getReportsDir()) |
||
86 | ->run(); |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * Run's the PHPMD. |
||
91 | * |
||
92 | * @return void |
||
93 | */ |
||
94 | public function runMd() |
||
107 | |||
108 | /** |
||
109 | * Run's the PHPCPD. |
||
110 | * |
||
111 | * @return void |
||
112 | */ |
||
113 | public function runCpd() |
||
126 | |||
127 | /** |
||
128 | * Run's the PHPCodeSniffer. |
||
129 | * |
||
130 | * @return void |
||
131 | */ |
||
132 | public function runCs() |
||
145 | |||
146 | /** |
||
147 | * Run's the PHPUnit tests. |
||
148 | * |
||
149 | * @return void |
||
150 | */ |
||
151 | public function runTests() |
||
152 | { |
||
153 | |||
154 | // run PHPUnit |
||
155 | $this->taskPHPUnit(sprintf('%s/bin/phpunit', $this->getVendorDir())) |
||
156 | ->configFile('phpunit.xml') |
||
157 | ->run(); |
||
158 | } |
||
159 | |||
160 | /** |
||
161 | * The complete build process. |
||
162 | * |
||
163 | * @return void |
||
164 | */ |
||
165 | public function build() |
||
174 | } |
||
175 |
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.