Code style fixes (camelCased variables).

This commit is contained in:
Dmitry Khomutov 2018-03-08 10:54:52 +07:00
commit 8d9c4824c7
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
15 changed files with 141 additions and 142 deletions

View file

@ -9,7 +9,7 @@ use PHPCensor\Plugin;
/**
* Behat BDD Plugin
*
*
* @author Dan Cryer <dan@block8.co.uk>
*/
class Behat extends Plugin
@ -50,7 +50,7 @@ class Behat extends Plugin
*/
public function execute()
{
$current_dir = getcwd();
$currentDir = getcwd();
chdir($this->builder->buildPath);
$behat = $this->executable;
@ -62,7 +62,7 @@ class Behat extends Plugin
}
$success = $this->builder->executeCommand($behat . ' %s', $this->features);
chdir($current_dir);
chdir($currentDir);
list($errorCount, $data) = $this->parseBehatOutput();

View file

@ -130,26 +130,26 @@ class Mysql extends Plugin
/**
* Builds the MySQL import command required to import/execute the specified file
*
* @param string $import_file Path to file, relative to the build root
* @param string $database If specified, this database is selected before execution
* @param string $importFile Path to file, relative to the build root
* @param string $database If specified, this database is selected before execution
*
* @return string
*/
protected function getImportCommand($import_file, $database = null)
protected function getImportCommand($importFile, $database = null)
{
$decompression = [
'bz2' => '| bzip2 --decompress',
'gz' => '| gzip --decompress',
];
$extension = strtolower(pathinfo($import_file, PATHINFO_EXTENSION));
$extension = strtolower(pathinfo($importFile, PATHINFO_EXTENSION));
$decompressionCmd = '';
if (array_key_exists($extension, $decompression)) {
$decompressionCmd = $decompression[$extension];
}
$args = [
':import_file' => escapeshellarg($import_file),
':import_file' => escapeshellarg($importFile),
':decomp_cmd' => $decompressionCmd,
':host' => escapeshellarg($this->host),
':user' => escapeshellarg($this->user),

View file

@ -97,8 +97,8 @@ class PhpSpec extends Plugin
$error['message'] = (String)$attr['message'];
}
foreach ($child->xpath('system-err') as $system_err) {
$error['raw'] = (String)$system_err;
foreach ($child->xpath('system-err') as $systemError) {
$error['raw'] = (String)$systemError;
}
$case['error'] = $error;

View file

@ -35,12 +35,12 @@ class PhpTalLint extends Plugin
/**
* @var int
*/
protected $allowed_warnings;
protected $allowedWarnings;
/**
* @var int
*/
protected $allowed_errors;
protected $allowedErrors;
/**
* @var array The results of the lint scan
@ -58,8 +58,8 @@ class PhpTalLint extends Plugin
$this->suffixes = ['zpt'];
$this->ignore = $this->builder->ignore;
$this->allowed_warnings = 0;
$this->allowed_errors = 0;
$this->allowedWarnings = 0;
$this->allowedErrors = 0;
if (!empty($options['directory'])) {
$this->directories = [$options['directory']];
@ -102,11 +102,11 @@ class PhpTalLint extends Plugin
$success = true;
if ($this->allowed_warnings != -1 && $warnings > $this->allowed_warnings) {
if ($this->allowedWarnings != -1 && $warnings > $this->allowedWarnings) {
$success = false;
}
if ($this->allowed_errors != -1 && $errors > $this->allowed_errors) {
if ($this->allowedErrors != -1 && $errors > $this->allowedErrors) {
$success = false;
}

View file

@ -39,39 +39,39 @@ class Codeception implements ParserInterface
$this->results = new \SimpleXMLElement($this->resultsXml);
// calculate total results
foreach ($this->results->testsuite as $test_suite) {
$this->totalTests += (int)$test_suite['tests'];
$this->totalTimeTaken += (float)$test_suite['time'];
$this->totalFailures += (int)$test_suite['failures'];
$this->totalErrors += (int)$test_suite['errors'];
foreach ($this->results->testsuite as $testSuite) {
$this->totalTests += (int)$testSuite['tests'];
$this->totalTimeTaken += (float)$testSuite['time'];
$this->totalFailures += (int)$testSuite['failures'];
$this->totalErrors += (int)$testSuite['errors'];
foreach ($test_suite->testcase as $test_case) {
$test_result = [
'suite' => (string)$test_suite['name'],
'file' => str_replace($this->builder->buildPath, '/', (string) $test_case['file']),
'name' => (string)$test_case['name'],
'feature' => (string)$test_case['feature'],
'assertions' => (int)$test_case['assertions'],
'time' => (float)$test_case['time']
foreach ($testSuite->testcase as $testCase) {
$testResult = [
'suite' => (string)$testSuite['name'],
'file' => str_replace($this->builder->buildPath, '/', (string) $testCase['file']),
'name' => (string)$testCase['name'],
'feature' => (string)$testCase['feature'],
'assertions' => (int)$testCase['assertions'],
'time' => (float)$testCase['time']
];
if (isset($test_case['class'])) {
$test_result['class'] = (string) $test_case['class'];
if (isset($testCase['class'])) {
$testResult['class'] = (string) $testCase['class'];
}
// PHPUnit testcases does not have feature field. Use class::method instead
if (!$test_result['feature']) {
$test_result['feature'] = sprintf('%s::%s', $test_result['class'], $test_result['name']);
if (!$testResult['feature']) {
$testResult['feature'] = sprintf('%s::%s', $testResult['class'], $testResult['name']);
}
if (isset($test_case->failure) || isset($test_case->error)) {
$test_result['pass'] = false;
$test_result['message'] = isset($test_case->failure) ? (string)$test_case->failure : (string)$test_case->error;
if (isset($testCase->failure) || isset($testCase->error)) {
$testResult['pass'] = false;
$testResult['message'] = isset($testCase->failure) ? (string)$testCase->failure : (string)$testCase->error;
} else {
$test_result['pass'] = true;
$testResult['pass'] = true;
}
$rtn[] = $test_result;
$rtn[] = $testResult;
}
}

View file

@ -140,10 +140,10 @@ class XMPP extends Plugin
/*
* Try to build conf file
*/
$config_file = $this->builder->buildPath . '/.sendxmpprc';
$configFile = $this->builder->buildPath . '/.sendxmpprc';
if (is_null($this->findConfigFile())) {
file_put_contents($config_file, $this->getConfigFormat());
chmod($config_file, 0600);
file_put_contents($configFile, $this->getConfigFormat());
chmod($configFile, 0600);
}
/*
@ -154,8 +154,8 @@ class XMPP extends Plugin
$tls = ' -t';
}
$message_file = $this->builder->buildPath . '/' . uniqid('xmppmessage');
if ($this->buildMessage($message_file) === false) {
$messageFile = $this->builder->buildPath . '/' . uniqid('xmppmessage');
if ($this->buildMessage($messageFile) === false) {
return false;
}
@ -165,23 +165,23 @@ class XMPP extends Plugin
$cmd = $sendxmpp . "%s -f %s -m %s %s";
$recipients = implode(' ', $this->recipients);
$success = $this->builder->executeCommand($cmd, $tls, $config_file, $message_file, $recipients);
$success = $this->builder->executeCommand($cmd, $tls, $configFile, $messageFile, $recipients);
print $this->builder->getLastOutput();
/*
* Remove temp message file
*/
$this->builder->executeCommand("rm -rf ".$message_file);
$this->builder->executeCommand("rm -rf ".$messageFile);
return $success;
}
/**
* @param $message_file
* @param $messageFile
* @return int
*/
protected function buildMessage($message_file)
protected function buildMessage($messageFile)
{
if ($this->build->isSuccessful()) {
$message = "✔ [".$this->build->getProjectTitle()."] Build #" . $this->build->getId()." successful";
@ -191,6 +191,6 @@ class XMPP extends Plugin
$message .= ' ('.strftime($this->dateFormat).')';
return file_put_contents($message_file, $message);
return file_put_contents($messageFile, $message);
}
}