__construct accesses the super-global variable $_ENV. Open
public function __construct($host, $user, $port)
{
$this->host = $host;
$this->user = $user;
$this->port = $port ?: 22;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
runCommands accesses the super-global variable $_ENV. Open
public function runCommands($commands, $output = false)
{
$key = $_ENV['SSH_KEY'];
$config = $_ENV['SSH_CONFIG'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
runCommand accesses the super-global variable $_ENV. Open
public function runCommand($command, $options = [])
{
$cwd = !empty($options['cwd']) ? $options['cwd'] : $this->location;
$env = !empty($options['env']) ? $options['env'] : $this->env;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getCommandPrefix accesses the super-global variable $_ENV. Open
private function getCommandPrefix($options = [])
{
$options['-i'] = !empty($options['pubkey']) ? $options['pubkey'] : $_ENV['SSH_KEY'];
$options['-F'] = !empty($options['config']) ? $options['config'] : $_ENV['SSH_CONFIG'];
$options['-p'] = !empty($options['port']) ? $options['port'] : $this->port;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getCommandPrefix accesses the super-global variable $_ENV. Open
private function getCommandPrefix($options = [])
{
$options['-i'] = !empty($options['pubkey']) ? $options['pubkey'] : $_ENV['SSH_KEY'];
$options['-F'] = !empty($options['config']) ? $options['config'] : $_ENV['SSH_CONFIG'];
$options['-p'] = !empty($options['port']) ? $options['port'] : $this->port;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
__construct accesses the super-global variable $_ENV. Open
public function __construct($host, $user, $port)
{
$this->host = $host;
$this->user = $user;
$this->port = $port ?: 22;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
runCommands accesses the super-global variable $_ENV. Open
public function runCommands($commands, $output = false)
{
$key = $_ENV['SSH_KEY'];
$config = $_ENV['SSH_CONFIG'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
runCommands accesses the super-global variable $_ENV. Open
public function runCommands($commands, $output = false)
{
$key = $_ENV['SSH_KEY'];
$config = $_ENV['SSH_CONFIG'];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
The method runCommands has a boolean flag argument $output, which is a certain sign of a Single Responsibility Principle violation. Open
public function runCommands($commands, $output = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid unused private methods such as 'getHost'. Open
private function getHost()
{
return $this->host;
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as 'getEnv'. Open
private function getEnv()
{
return $this->env;
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as 'getPort'. Open
private function getPort()
{
return $this->port;
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as 'getLocation'. Open
private function getLocation()
{
return $this->location;
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused private methods such as 'getUser'. Open
private function getUser()
{
return $this->user;
}
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}