Skip to content

Commit

Permalink
Updating documentation and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nocturnalfrog committed Sep 14, 2014
1 parent 0a5947c commit 982bd8b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function(grunt) {

phpcs: {
application: {
dir: ['php/**']
src: ['php/**']
},
options: {
bin: 'vendor/bin/phpcs',
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ _This task is a [multi task][] so any targets, files and options should be speci
```js
phpcs: {
application: {
dir: ['application/classes/*.php', 'application/lib/**/*.php']
src: ['application/classes/*.php', 'application/lib/**/*.php']
},
options: {
bin: 'vendor/bin/phpcs',
Expand All @@ -43,7 +43,7 @@ phpcs: {
```

###Target Properties
####dir
####src
Type: `Array`

Globbing pattern where phpcs should search for files.
Expand Down
14 changes: 7 additions & 7 deletions tasks/lib/phpcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exports.init = function(grunt) {
*
* @return string
*/
var buildCommand = function(dir) {
var buildCommand = function() {

var cmd = path.normalize(config.bin);

Expand Down Expand Up @@ -117,13 +117,13 @@ exports.init = function(grunt) {
* @param Object runner
*/
exports.setup = function(runner) {
var dir, attr;
var files, attr;

if(runner.data.dir){
dir = runner.data.dir;
grunt.log.writeln("The 'dir' option is deprecated, please use 'scr' instead.");
files = runner.data.dir;
grunt.log.writeln("The 'dir' target property is deprecated, please use 'scr' instead.");
}else{
dir = runner.files[0].src;
files = runner.files[0].src;
}

config = runner.options(defaults);
Expand All @@ -134,9 +134,9 @@ exports.init = function(grunt) {
}
}

cmd = buildCommand(dir) + ' ' + grunt.file.expand(dir).join(' ');
cmd = buildCommand() + ' ' + grunt.file.expand(files).join(' ');

grunt.log.writeln('Starting phpcs (target: ' + runner.target.cyan + ') in ' + dir.join(' ').cyan);
grunt.log.writeln('Starting phpcs (target: ' + runner.target.cyan + ') in ' + files.join(' ').cyan);
grunt.verbose.writeln('Exec: ' + cmd);

done = runner.async();
Expand Down

0 comments on commit 982bd8b

Please sign in to comment.