From bc94b2d919004a698b910026ae02fb445c085b7c Mon Sep 17 00:00:00 2001 From: Gert Date: Sun, 19 May 2019 21:11:10 +0200 Subject: [PATCH] Clean up PhpInvoker after decaffeinate References #460 --- lib/PhpInvoker.js | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/lib/PhpInvoker.js b/lib/PhpInvoker.js index a7950e6b..4d606b50 100644 --- a/lib/PhpInvoker.js +++ b/lib/PhpInvoker.js @@ -1,21 +1,17 @@ /* global atom */ -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -let PhpInvoker; +'use strict'; + const os = require('os'); const child_process = require('child_process'); module.exports = -//#* -// Invokes PHP. -//# -(PhpInvoker = class PhpInvoker { +/** + * Invokes PHP. + */ +class PhpInvoker +{ /** * Constructor. * @@ -85,11 +81,11 @@ module.exports = // NOTE: Uncomment this to test failures process.stdout.on('data', data => { - return console.debug('STDOUT', data.toString()); + console.debug('STDOUT', data.toString()); }); process.stderr.on('data', data => { - return console.debug('STDERR', data.toString()); + console.debug('STDERR', data.toString()); }); return process; @@ -102,9 +98,9 @@ module.exports = */ getDockerRunParameters(dockerImage, additionalDockerRunParameters) { const parameters = ['run', '--rm=true']; - const object = this.getPathsToMountInDockerContainer(); - for (let src in object) { + + for (const src in object) { const dest = object[src]; parameters.push('-v'); parameters.push(src + ':' + dest); @@ -161,10 +157,8 @@ module.exports = const matches = path.match(/^([A-Z]+):(.+)$/); - // Path already normalized. if (matches !== null) { - // On Windows, paths for Docker volumes are specified as - // /c/Path/To/Item. + // On Windows, paths for Docker volumes are specified as /c/Path/To/Item. path = `/${matches[1].toLowerCase()}${matches[2]}`; } @@ -183,10 +177,8 @@ module.exports = const matches = path.match(/^\/([a-z]+)\/(.+)$/); - // Path already denormalized. if (matches !== null) { - // On Windows, paths for Docker volumes are specified as - // /c/Path/To/Item. + // On Windows, paths for Docker volumes are specified as /c/Path/To/Item. path = matches[1].toUpperCase() + ':\\' + matches[2]; } @@ -227,4 +219,4 @@ module.exports = return this.denormalizeVolumePath(path); } -}); +};