bwinkers/nugget

View on GitHub
src/SClient.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using empty try-catch blocks in __construct.
Open

        } catch (NuggetException $ex) {
            
        }
Severity: Minor
Found in src/SClient.php by phpmd

EmptyCatchBlock

Since: 2.7.0

Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

Example

class Foo {

  public function bar()
  {
      try {
          // ...
      } catch (Exception $e) {} // empty catch block
  }
}

Source https://phpmd.org/rules/design.html#emptycatchblock

Saw an @param annotation for secret, but it was not found in the param list of function __construct($config)
Open

     * @param string $secret
Severity: Info
Found in src/SClient.php by phan

Saw an @param annotation for key, but it was not found in the param list of function __construct($config)
Open

     * @param string $key
Severity: Info
Found in src/SClient.php by phan

Either remove or fill this block of code.
Open

        } catch (NuggetException $ex) {
            
        }
Severity: Major
Found in src/SClient.php by sonar-php

Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.

Noncompliant Code Example

for ($i = 0; $i < 42; $i++){}  // Empty on purpose or missing piece of code ?

Exceptions

When a block contains a comment, this block is not considered to be empty.

Possibly zero references to use statement for classlike/namespace S3Client (\Aws\S3\S3Client)
Open

use Aws\S3\S3Client;
Severity: Minor
Found in src/SClient.php by phan

Reference to undeclared class \Aws\S3\S3Client
Open

            parent::__construct($config);
Severity: Critical
Found in src/SClient.php by phan

Class extends undeclared class \Aws\S3\S3Client
Open

class SClient extends \Aws\S3\S3Client
Severity: Critical
Found in src/SClient.php by phan

Blank line found at start of control structure
Open

        } catch (NuggetException $ex) {
Severity: Minor
Found in src/SClient.php by phpcodesniffer

Whitespace found at end of line
Open

     * 
Severity: Minor
Found in src/SClient.php by phpcodesniffer

Expected 1 newline at end of file; 0 found
Open

}
Severity: Minor
Found in src/SClient.php by phpcodesniffer

There are no issues that match your filters.

Category
Status