Skip to content

Commit e8d7daf

Browse files
webdevlabsStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent ece20fc commit e8d7daf

File tree

8 files changed

+104
-78
lines changed

8 files changed

+104
-78
lines changed

bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @link https://www.webdevlabs.com
1111
*/
1212
if (version_compare(phpversion(), '5.6.0', '<')) {
13-
die('PHP5.6+ Required! PHP7 Recommended.');
13+
exit('PHP5.6+ Required! PHP7 Recommended.');
1414
}
1515

1616
/*

plugins/websocket/socket.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct($host = '127.0.0.1', $port = 12345, $max = 100)
3535
private function createSocket($host, $port)
3636
{
3737
if (($this->master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) < 0) {
38-
die('socket_create() failed, reason: '.socket_strerror($this->master));
38+
exit('socket_create() failed, reason: '.socket_strerror($this->master));
3939
}
4040

4141
self::console("Socket {$this->master} created.");
@@ -44,13 +44,13 @@ private function createSocket($host, $port)
4444
//socket_set_option($master,SOL_SOCKET,SO_KEEPALIVE,1);
4545

4646
if (($ret = socket_bind($this->master, $host, $port)) < 0) {
47-
die('socket_bind() failed, reason: '.socket_strerror($ret));
47+
exit('socket_bind() failed, reason: '.socket_strerror($ret));
4848
}
4949

5050
self::console("Socket bound to {$host}:{$port}.");
5151

5252
if (($ret = socket_listen($this->master, 5)) < 0) {
53-
die('socket_listen() failed, reason: '.socket_strerror($ret));
53+
exit('socket_listen() failed, reason: '.socket_strerror($ret));
5454
}
5555

5656
self::console('Start listening on Socket.');

system/Console.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function run($command)
2121

2222
return new $clsname();
2323
} else {
24-
die('Command not found.');
24+
exit('Command not found.');
2525
}
2626
}
2727
}

system/DatabaseEloquent.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ public function connect()
1616
{
1717
$capsule = new Capsule();
1818
$capsule->addConnection([
19-
'driver' => 'mysql',
20-
'host' => $this->conf->database['mysql']['host'],
21-
'database' => $this->conf->database['mysql']['dbname'],
22-
'username' => $this->conf->database['mysql']['username'],
23-
'password' => $this->conf->database['mysql']['password'],
19+
'driver' => 'mysql',
20+
'host' => $this->conf->database['mysql']['host'],
21+
'database' => $this->conf->database['mysql']['dbname'],
22+
'username' => $this->conf->database['mysql']['username'],
23+
'password' => $this->conf->database['mysql']['password'],
2424
]);
2525

2626
//Make this Capsule instance available globally.

system/DatabasePdo.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ public function connect()
1616
/* Create a new PDO connection to MySQL **/
1717
try {
1818
$pdo = new \PDO(
19-
'mysql:dbname='.$this->conf->database['mysql']['dbname'].';
19+
'mysql:dbname='.$this->conf->database['mysql']['dbname'].';
2020
host='.$this->conf->database['mysql']['host'],
21-
$this->conf->database['mysql']['username'],
22-
$this->conf->database['mysql']['password'],
23-
[
24-
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES '.$this->conf->database['mysql']['charset'],
25-
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
26-
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
27-
]
28-
);
21+
$this->conf->database['mysql']['username'],
22+
$this->conf->database['mysql']['password'],
23+
[
24+
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES '.$this->conf->database['mysql']['charset'],
25+
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
26+
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
27+
]
28+
);
2929
$pdo->exec('SET CHARACTER SET '.$this->conf->database['mysql']['charset']);
3030
$pdo->exec('SET CHARACTER_SET_CONNECTION='.$this->conf->database['mysql']['charset']);
3131
$pdo->exec("SET SQL_MODE = ''");

0 commit comments

Comments
 (0)