railpage/railpagecore

View on GitHub
lib/Railcams/Authorisation.php

Summary

Maintainability
A
0 mins
Test Coverage

The parameter $Camera is not named in camelCase.
Open

    public static function getAuthIPs(Camera $Camera) {
        
        if (!isset($Camera->meta['auth_ips'])) {
            return "";
        }
Severity: Minor
Found in lib/Railcams/Authorisation.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $Camera is not named in camelCase.
Open

    public static function validateAuthToken(Camera $Camera, $token = null) {
        
        $token = trim(preg_replace("/(Basic|Token)/i", "", $token)); 
        
        if ($token == self::getAuthToken($Camera)) {
Severity: Minor
Found in lib/Railcams/Authorisation.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $Camera is not named in camelCase.
Open

    public static function getAuthToken(Camera $Camera) {
        
        if (!isset($Camera->meta['auth_token'])) {
            $Camera->meta['auth_token'] = bin2hex(openssl_random_pseudo_bytes(16));
            $Camera->commit(); 
Severity: Minor
Found in lib/Railcams/Authorisation.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

There are no issues that match your filters.

Category
Status