Fix code style

This commit is contained in:
Amine Ben hammou
2019-06-17 20:11:04 +01:00
committed by M. Shull
parent 9588ce4515
commit 05a4ebad04

View File

@@ -36,8 +36,8 @@ class RoboFile extends \Robo\Tasks {
function watch() {
$this->say('Warning: this lints and compiles all files, not just the changed one. Use separate tasks watch:js and watch:css for faster and more efficient watching.');
$css_files = $this->rsearch('assets/css/src/', array('scss'));
$js_files = $this->rsearch('assets/js/src/', array('js', 'jsx'));
$css_files = $this->rsearch('assets/css/src/', ['scss']);
$js_files = $this->rsearch('assets/js/src/', ['js', 'jsx']);
$this->taskWatch()
->monitor($js_files, function() {
@@ -50,7 +50,7 @@ class RoboFile extends \Robo\Tasks {
}
function watchCss() {
$css_files = $this->rsearch('assets/css/src/', array('scss'));
$css_files = $this->rsearch('assets/css/src/', ['scss']);
$this->taskWatch()
->monitor($css_files, function($changedFile) {
$file = $changedFile->getResource()->getResource();
@@ -71,10 +71,10 @@ class RoboFile extends \Robo\Tasks {
function compileAll($opts = ['env' => null]) {
$collection = $this->collectionBuilder();
$collection->addCode(function() use ($opts) {
return call_user_func(array($this, 'compileJs'), $opts);
return call_user_func([$this, 'compileJs'], $opts);
});
$collection->addCode(function() use ($opts) {
return call_user_func(array($this, 'compileCss'), $opts);
return call_user_func([$this, 'compileCss'], $opts);
});
return $collection->run();
}
@@ -191,12 +191,12 @@ class RoboFile extends \Robo\Tasks {
}
function testCoverage($opts=['file' => null, 'xml' => false]) {
$command = join(' ', array(
$command = join(' ', [
'vendor/bin/codecept run -s acceptance',
(($opts['file']) ? $opts['file'] : ''),
'--coverage',
($opts['xml']) ? '--coverage-xml' : '--coverage-html'
));
($opts['xml']) ? '--coverage-xml' : '--coverage-html',
]);
if ($opts['xml']) {
$command .= ' --xml';
@@ -208,11 +208,11 @@ class RoboFile extends \Robo\Tasks {
function testJavascript($xml_output_file = null) {
$this->compileJs();
$command = join(' ', array(
$command = join(' ', [
'./node_modules/.bin/mocha',
'-r tests/javascript/mochaTestHelper.js',
'tests/javascript/testBundles/**/*.js'
));
'tests/javascript/testBundles/**/*.js',
]);
if (!empty($xml_output_file)) {
$command .= sprintf(
@@ -296,19 +296,19 @@ class RoboFile extends \Robo\Tasks {
$dump_file,
$dumper->dump([
'class' => $configurator->getDumpClassname(),
'namespace' => $configurator->getDumpNamespace()
'namespace' => $configurator->getDumpNamespace(),
])
);
}
function qa() {
$collection = $this->collectionBuilder();
$collection->addCode(array($this, 'qaLint'));
$collection->addCode([$this, 'qaLint']);
$collection->addCode(function() {
return $this->qaCodeSniffer('all');
});
$collection->addCode(array($this, 'qaLintJavascript'));
$collection->addCode(array($this, 'qaLintCss'));
$collection->addCode([$this, 'qaLintJavascript']);
$collection->addCode([$this, 'qaLintCss']);
return $collection->run();
}
@@ -439,7 +439,7 @@ class RoboFile extends \Robo\Tasks {
if (file_exists("$svn_dir/trunk_new") || file_exists("$svn_dir/trunk_old")) {
$collection->taskFileSystemStack()
->stopOnFail()
->remove(array("$svn_dir/trunk_new", "$svn_dir/trunk_old"));
->remove(["$svn_dir/trunk_new", "$svn_dir/trunk_old"]);
}
// Extract the distributable zip to tmp trunk dir
@@ -743,7 +743,7 @@ class RoboFile extends \Robo\Tasks {
$this->say("Release '$version[name]' info was published on Slack.");
}
protected function rsearch($folder, $extensions = array()) {
protected function rsearch($folder, $extensions = []) {
$dir = new RecursiveDirectoryIterator($folder);
$iterator = new RecursiveIteratorIterator($dir);
@@ -755,7 +755,7 @@ class RoboFile extends \Robo\Tasks {
RecursiveRegexIterator::GET_MATCH
);
$list = array();
$list = [];
foreach ($files as $file) {
$list[] = $file[0];
}