Skip to content

Commit 3fd8146

Browse files
Merge pull request #3 from javanile/analysis-8KvyYR
Apply fixes from StyleCI
2 parents 3454b44 + 3ad583c commit 3fd8146

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/MysqlImport.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function __construct($env, $argv)
121121

122122
// Set fix host port
123123
if (preg_match('/:([0-9]+)$/', $this->host, $matches)) {
124-
$this->host = substr($this->host, 0 , -1 - strlen($matches[1]));
124+
$this->host = substr($this->host, 0, -1 - strlen($matches[1]));
125125
$this->port = $matches[1];
126126
}
127127

@@ -351,7 +351,7 @@ protected function messageDatabaseNotBlank()
351351
{
352352
$this->exitCode = 0;
353353

354-
return $this->message("required blank database for import.");
354+
return $this->message('required blank database for import.');
355355
}
356356

357357
/**
@@ -373,7 +373,7 @@ protected function messageConnectionProblem($user)
373373
/**
374374
* Get exit code after run.
375375
*
376-
* @return integer
376+
* @return int
377377
*/
378378
public function getExitCode()
379379
{
@@ -386,10 +386,10 @@ public function getExitCode()
386386
public function getInfo()
387387
{
388388
return [
389-
'state' => $this->state,
390-
'host' => $this->host,
391-
'port' => $this->port,
392-
'database' => $this->database
389+
'state' => $this->state,
390+
'host' => $this->host,
391+
'port' => $this->port,
392+
'database' => $this->database,
393393
];
394394
}
395395
}

tests/MysqlImportTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testDropAndCreateDatabase()
5353
public function testNotBlankDatabase()
5454
{
5555
$sqlFile = __DIR__.'/fixtures/database.sql';
56-
$message = "[mysql-import] required blank database for import.";
56+
$message = '[mysql-import] required blank database for import.';
5757

5858
$app = new MysqlImport(['MYSQL_ROOT_PASSWORD' => 'root'], [$sqlFile]);
5959
$app->run();
@@ -85,9 +85,9 @@ public function testConnectionProblemWrongHost()
8585
$this->assertStringStartsWith($message, $app->run());
8686

8787
$app = new MysqlImport([
88-
'MYSQL_HOST' => 'wrong',
89-
'MYSQL_USER' => 'root',
90-
'MYSQL_PASSWORD' => 'wrong'],
88+
'MYSQL_HOST' => 'wrong',
89+
'MYSQL_USER' => 'root',
90+
'MYSQL_PASSWORD' => 'wrong', ],
9191
[$sqlFile]
9292
);
9393
$this->assertStringStartsWith($message, $app->run());
@@ -118,10 +118,10 @@ public function testHostPortFix()
118118

119119
$app = new MysqlImport(['WORDPRESS_DB_HOST' => 'db:10101'], [$sqlFile]);
120120
$this->assertEquals([
121-
'state' => 'ready',
122-
'host' => 'db',
123-
'port' => 10101,
124-
'database' => 'database'
121+
'state' => 'ready',
122+
'host' => 'db',
123+
'port' => 10101,
124+
'database' => 'database',
125125
], $app->getInfo());
126126
}
127127

@@ -131,17 +131,17 @@ public function testDefaultDatabaseName()
131131

132132
$app = new MysqlImport(['WORDPRESS_DB_PASSWORD' => 'root'], [$sqlFile]);
133133
$this->assertEquals([
134-
'state' => 'ready',
135-
'host' => 'mysql',
136-
'port' => 3306,
137-
'database' => 'wordpress'
134+
'state' => 'ready',
135+
'host' => 'mysql',
136+
'port' => 3306,
137+
'database' => 'wordpress',
138138
], $app->getInfo());
139139
}
140140

141141
public function testSyntaxError()
142142
{
143143
$sqlFile = __DIR__.'/fixtures/syntax_error.sql';
144-
$message = "[mysql-import] You have an error in your SQL syntax; check the manual that corresponds to";
144+
$message = '[mysql-import] You have an error in your SQL syntax; check the manual that corresponds to';
145145

146146
$app = new MysqlImport(['MYSQL_ROOT_PASSWORD' => 'root'], [$sqlFile]);
147147
$this->assertStringStartsWith($message, $app->run());

0 commit comments

Comments
 (0)