Skip to content

Commit 7060e8e

Browse files
committed
Review PR #63.
1 parent 4f71309 commit 7060e8e

File tree

13 files changed

+1070
-537
lines changed

13 files changed

+1070
-537
lines changed

.buildpath

Lines changed: 441 additions & 89 deletions
Large diffs are not rendered by default.

Gruntfile.js

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ module.exports = function(grunt) {
44

55
grunt.initConfig(
66
{
7-
7+
88
/**
99
* Reads the 'package.json' file and puts it content into a 'pkg' Javascript object.
1010
*/
1111
pkg : grunt.file.readJSON('package.json'),
12-
12+
1313
/**
1414
* Clean task.
1515
*/
1616
clean : ['build'],
17-
17+
1818
/**
1919
* Copy task.
2020
*/
2121
copy : {
22-
22+
2323
/**
2424
* Copy test resource files to the build.
2525
*/
@@ -33,20 +33,20 @@ module.exports = function(grunt) {
3333
}
3434
]
3535
}
36-
36+
3737
}, /* Copy task */
3838

3939
/**
4040
* PHPUnit Task.
4141
*/
4242
phpunit : {
43-
43+
4444
classes: {
4545
dir: 'src/test/php'
46-
},
47-
46+
},
47+
4848
options: {
49-
bin : 'vendor/bin/phpunit',
49+
bin : 'vendor/bin/phpunit',
5050
configuration : 'phpunit.xml.dist',
5151
//group : 'CURLClientTest'
5252
}
@@ -57,34 +57,34 @@ module.exports = function(grunt) {
5757
* Shell Task
5858
*/
5959
shell : {
60-
60+
6161
pdepend : {
6262
command : function() {
63-
63+
6464
var command = 'php vendor/pdepend/pdepend/src/bin/pdepend';
6565
command += ' --jdepend-chart=build/reports/pdepend/jdepend-chart.svg';
6666
command += ' --jdepend-xml=build/reports/pdepend/jdepend.xml';
6767
command += ' --overview-pyramid=build/reports/pdepend/overview-pyramid.svg';
6868
command += ' --summary-xml=build/reports/pdepend/summary.xml';
6969
command += ' src/main/php';
70-
70+
7171
return command;
7272

7373
}
7474
},
75-
75+
7676
phpcs : {
7777
command : function() {
78-
79-
var command = 'php ./vendor/squizlabs/php_codesniffer/bin/phpcs';
78+
79+
var command = 'php ./vendor/squizlabs/php_codesniffer/bin/phpcs';
8080
command += ' --cache';
8181
command += ' --filter=GitModified';
8282
command += ' --parallel=16'; // Requires PHP to be compiled with PCNTL package
8383
command += ' --standard=PSR2';
8484
command += ' -v';
85-
85+
8686
if(grunt.option('checkstyle') === true) {
87-
87+
8888
command += ' --report=checkstyle';
8989
command += ' --report-file=target/reports/phpcs/phpcs.xml';
9090
}
@@ -93,13 +93,13 @@ module.exports = function(grunt) {
9393
command += ' src/test/php/Gomoob';
9494

9595
return command;
96-
96+
9797
}
9898
},
99-
99+
100100
phpcbf : {
101101
command : function() {
102-
102+
103103
var command = 'php ./vendor/squizlabs/php_codesniffer/scripts/phpcbf';
104104
var command = 'php ./vendor/squizlabs/php_codesniffer/bin/phpcbf';
105105
command += ' --cache';
@@ -108,37 +108,37 @@ module.exports = function(grunt) {
108108
command += ' --standard=PSR2';
109109
command += ' src/main/php';
110110
command += ' src/test/php';
111-
111+
112112
return command;
113-
113+
114114
}
115115
},
116-
116+
117117
phpcpd : {
118118
command : function() {
119-
119+
120120
return 'php vendor/sebastian/phpcpd/phpcpd src/main/php';
121121

122122
}
123123
},
124-
124+
125125
phpdocumentor : {
126126
command : function() {
127127
return 'php vendor/phpdocumentor/phpdocumentor/bin/phpdoc.php --target=build/reports/phpdocumentor --directory=src/main/php';
128128
}
129129
},
130-
130+
131131
phploc : {
132132
command : function() {
133-
133+
134134
return 'php vendor/phploc/phploc/phploc src/main/php';
135-
135+
136136
}
137137
},
138-
138+
139139
phpmd : {
140140
command : function() {
141-
141+
142142
var command = 'php vendor/phpmd/phpmd/src/bin/phpmd ';
143143
command += 'src/main/php ';
144144
command += 'html ';
@@ -152,13 +152,13 @@ module.exports = function(grunt) {
152152
callback : function(err, stdout, stderr, cb) {
153153
grunt.file.write('build/reports/phpmd/phpmd.html', stdout);
154154
cb();
155-
155+
156156
}
157157
}
158158
}
159-
159+
160160
} /* Shell Task */
161-
161+
162162
}
163163

164164
); /* Grunt initConfig call */
@@ -189,13 +189,13 @@ module.exports = function(grunt) {
189189
* Task used to create directories needed by PHP_CodeSniffer to generate its report.
190190
*/
191191
grunt.registerTask('before-phpcs', 'Creating directories required by PHP Code Sniffer...', function() {
192-
192+
193193
if(grunt.option('checkstyle') === true) {
194194

195195
if(!fs.existsSync('build')) {
196196
fs.mkdirSync('build');
197197
}
198-
198+
199199
if(!fs.existsSync('build/reports')) {
200200
fs.mkdirSync('build/reports');
201201
}
@@ -205,14 +205,14 @@ module.exports = function(grunt) {
205205
}
206206

207207
}
208-
208+
209209
});
210-
210+
211211
/**
212212
* Task used to create directories needed by PHPMD to generate its report.
213213
*/
214214
grunt.registerTask('before-phpmd', 'Creating directories required by PHP Mess Detector...', function() {
215-
215+
216216
if(!fs.existsSync('build')) {
217217
fs.mkdirSync('build');
218218
}
@@ -224,39 +224,39 @@ module.exports = function(grunt) {
224224
if(!fs.existsSync('build/reports/phpmd')) {
225225
fs.mkdirSync('build/reports/phpmd');
226226
}
227-
227+
228228
});
229229

230230
/**
231231
* Task used to generate a PDepend report.
232232
*/
233233
grunt.registerTask('pdepend', ['before-pdepend', 'shell:pdepend']);
234-
234+
235235
/**
236236
* Task used to automatically fix PHP_CodeSniffer errors.
237237
*/
238238
grunt.registerTask('phpcbf', ['shell:phpcbf']);
239-
239+
240240
/**
241241
* Task used to check the code using PHP_CodeSniffer.
242242
*/
243243
grunt.registerTask('phpcs', ['before-phpcs', 'shell:phpcs']);
244-
244+
245245
/**
246246
* Task used to generate a PHPMD report.
247247
*/
248248
grunt.registerTask('phpmd', ['before-phpmd', 'shell:phpmd']);
249-
249+
250250
/**
251251
* Task used to create the project documentation.
252252
*/
253253
grunt.registerTask('generate-documentation', ['pdepend', 'phpcs', 'phpmd', 'shell:phpdocumentor']);
254-
254+
255255
/**
256256
* Task used to execute the project tests.
257257
*/
258258
grunt.registerTask('test', ['copy:test-resources', 'phpunit']);
259-
259+
260260
/**
261261
* Default task, this task executes the following actions :
262262
* - Clean the previous build folder

0 commit comments

Comments
 (0)