You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that it randomly fails, but every time at a different PHP file.
The error message is:
Fatal error: Cannot read property 'on' of undefined
TypeError: Cannot read property 'on' of undefined
at Object.PhpLintCommandWrapper.lintFile (/.../grunt-phplint/tasks/core/PhpLintCommandWrapper.js:24:20)
at /.../grunt-phplint/tasks/core/PhpLintTask.js:73:11
at Object.PhpLintTask._checkCached (/.../grunt-phplint/tasks/core/PhpLintTask.js:116:11)
at Object.PhpLintTask._lintFile (/.../grunt-phplint/tasks/core/PhpLintTask.js:60:8)
at bound (/.../grunt-phplint/node_modules/grunt-legacy-util/node_modules/lodash/lodash.js:573:19)
at replenish (/.../grunt-phplint/node_modules/grunt-legacy-util/node_modules/async/lib/async.js:144:17)
at /.../grunt-phplint/node_modules/grunt-legacy-util/node_modules/async/lib/async.js:156:29
at /.../grunt-phplint/tasks/core/PhpLintTask.js:95:13
at ChildProcess.<anonymous> (/.../grunt-phplint/tasks/core/PhpLintCommandWrapper.js:37:4)
at emitTwo (events.js:87:13)
When I decrease the options.spawnLimit to 4 or less it works as expected.
I have added a console.log() to see what is there.
PhpLintCommandWrapper.prototype={lintFile: function(filePath,done){varcmdArgs=this._parseOptions(this.options.phpArgs),phpLintCmd=spawn(this.options.phpCmd,cmdArgs.concat([filePath])),output="";if(typeofphpLintCmd.stdout==='undefined'){console.log(JSON.stringify(Object.keys(phpLintCmd),null,2));}// Line 24.phpLintCmd.stdout.on("data",function(data){output+=data;});// ...}}
For testing purposes a I tried to lint the /core directory of Drupal 8. It contains ~6200 PHP files.
It takes ~17sec to run this command:
time find ./ -type f \( -name '*.php' -or -name '*.inc' -or -name '*.install' -or -name '*.profile' \) -print0 | xargs -0 -P8 -n1 php -n -d sort_open_tag=Off -d asp_tags=Off -l
I am using the following configuration to achieve the same thing with grunt-phplint
The problem is that it randomly fails, but every time at a different PHP file.
The error message is:
When I decrease the
options.spawnLimit
to 4 or less it works as expected.I have added a
console.log()
to see what is there.The text was updated successfully, but these errors were encountered: