immense/php-macaroons

View on GitHub

Showing 65 of 65 total issues

Missing class import via use statement (line '58', column '17').
Open

      throw new \InvalidArgumentException('Must supply updated signature');
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '73', column '17').
Open

      throw new \InvalidArgumentException('Callback must be a function');
Severity: Minor
Found in lib/Macaroons/Verifier.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '57', column '17').
Open

      throw new \InvalidArgumentException('Must provide predicate');
Severity: Minor
Found in lib/Macaroons/Verifier.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '41', column '17').
Open

      throw new \InvalidArgumentException('Both arguments must be strings');
Severity: Minor
Found in lib/Macaroons/Utils.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '49', column '17').
Open

      throw new \InvalidArgumentException('Data is too long for a binary packet.');
Severity: Minor
Found in lib/Macaroons/Packet.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '71', column '17').
Open

      throw new \InvalidArgumentException('Must provide a callback function');
Severity: Minor
Found in lib/Macaroons/Verifier.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid using static access to class 'Macaroons\Utils' in method 'addThirdPartyCaveat'.
Open

    $derivedCaveatKey = Utils::truncateOrPad( Utils::generateDerivedKey($caveatKey) );
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 'Macaroons\Utils' in method 'bindSignature'.
Open

    $currentSignatureHash = Utils::hmac($key, Utils::unhexlify($this->getSignature()));
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 'Macaroons\Utils' in method 'bindSignature'.
Open

    $key                  = Utils::truncateOrPad("\0");
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 'Macaroons\Utils' in method 'bindSignature'.
Open

    return Utils::hmac($key, $currentSignatureHash . $newSignatureHash);
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 'Macaroons\Utils' in method 'verifyDischarge'.
Open

    $signature = Utils::unhexlify($macaroon->getSignature());
Severity: Minor
Found in lib/Macaroons/Verifier.php by phpmd

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 'Macaroons\Utils' in method 'verifyFirstPartyCaveat'.
Open

      $this->calculatedSignature = Utils::signFirstPartyCaveat($this->calculatedSignature, $caveat->getCaveatId());
Severity: Minor
Found in lib/Macaroons/Verifier.php by phpmd

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 'Macaroons\Utils' in method 'addFirstPartyCaveat'.
Open

    $this->signature = Utils::signFirstPartyCaveat($this->signature, $predicate);
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 'Macaroons\Utils' in method 'addThirdPartyCaveat'.
Open

    $this->signature = Utils::signThirdPartyCaveat($this->signature, $verificationId, $caveatId);
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 'Macaroons\Utils' in method 'addThirdPartyCaveat'.
Open

    $derivedCaveatKey = Utils::truncateOrPad( Utils::generateDerivedKey($caveatKey) );
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 'Macaroons\Utils' in method 'bindSignature'.
Open

    $newSignatureHash     = Utils::hmac($key, Utils::unhexlify($signature));
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 'Macaroons\Utils' in method 'toJSON'.
Open

          $caveatAsArray['vid'] = Utils::hexlify($caveatAsArray['vid']);
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 'Macaroons\Utils' in method 'serialize'.
Open

    return Utils::base64_url_encode($s);
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

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 unused private methods such as 'mapPacketsCallback'.
Open

  private function mapPacketsCallback($key, $data)
  {
    return $this->encode($key, $data);
  }
Severity: Minor
Found in lib/Macaroons/Packet.php by phpmd

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 fields such as '$id'.
Open

  private $id;
Severity: Minor
Found in lib/Macaroons/Macaroon.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Severity
Category
Status
Source
Language