Remove error control operator '@' on line 45. Open
protected function loadClusterVersion(): void
{
if ($this->kubernetesVersion) {
return;
}
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Avoid using static access to class '\vierbergenlars\SemVer\version' in method 'olderThan'. Open
return Semver::lt(
$this->kubernetesVersion, $kubernetesVersion
);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\vierbergenlars\SemVer\version' in method 'newerThan'. Open
return Semver::gte(
$this->kubernetesVersion, $kubernetesVersion
);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Only one argument is allowed per line in a multi-line function call Open
$this->kubernetesVersion, $kubernetesVersion
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
$this->kubernetesVersion, $kubernetesVersion
- Exclude checks