Skip to content

Commit fc7afcd

Browse files
committed
Remove newline, edit phpdoc, bail on exception
1 parent 828998c commit fc7afcd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

includes/class-wp-php-console.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,24 @@ private function set_admin() {
9999
/**
100100
* Connects to PHP Console.
101101
*
102+
* PHP Console needs to hook in session, in WordPress we need to be in 'init':
103+
* @link http://silvermapleweb.com/using-the-php-session-in-wordpress/
102104
* @internal action hook callback
103105
*
104106
* @since 1.4.0
105107
*/
106108
public function connect() {
107109

108-
/**
109-
* PhpConsole needs to hook in session, in WordPress we need to be in 'init':
110-
* @link http://silvermapleweb.com/using-the-php-session-in-wordpress/
111-
*/
112110
if ( ! @session_id() ) {
113111
@session_start();
114112
}
115113

116-
117114
if ( ! $this->connector instanceof PhpConsole\Connector ) {
118115
try {
119116
$this->connector = PhpConsole\Connector::getInstance();
120-
} catch ( \Exception $e ) {}
117+
} catch ( \Exception $e ) {
118+
return;
119+
}
121120
}
122121

123122
// apply PHP Console options
@@ -195,7 +194,7 @@ private function apply_options() {
195194
public function init() {
196195

197196
// get PHP Console extension password
198-
$password = isset( $this->options['password'] ) ? trim( $this->options['password'] ) : null;
197+
$password = trim( $this->options['password'] );
199198

200199
if ( empty( $password ) ) {
201200

0 commit comments

Comments
 (0)