The class Utils has 13 public methods. Consider refactoring Utils to keep number of public methods under 10. Open
class Utils
{
public static function hexlify($value)
{
return join('', array_map(function($byte){
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
Missing class import via use statement (line '41', column '17'). Open
throw new \InvalidArgumentException('Both arguments must be strings');
- Read upRead up
- Exclude checks
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
The variable $verification_id_hmac is not named in camelCase. Open
public static function signThirdPartyCaveat($signature, $verificationId, $caveatId)
{
$verification_id_hmac = self::hmac($signature, $verificationId);
$caveat_id_hmac = self::hmac($signature, $caveatId);
$combined = $verification_id_hmac . $caveat_id_hmac;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $caveat_id_hmac is not named in camelCase. Open
public static function signThirdPartyCaveat($signature, $verificationId, $caveatId)
{
$verification_id_hmac = self::hmac($signature, $verificationId);
$caveat_id_hmac = self::hmac($signature, $caveatId);
$combined = $verification_id_hmac . $caveat_id_hmac;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $verification_id_hmac is not named in camelCase. Open
public static function signThirdPartyCaveat($signature, $verificationId, $caveatId)
{
$verification_id_hmac = self::hmac($signature, $verificationId);
$caveat_id_hmac = self::hmac($signature, $caveatId);
$combined = $verification_id_hmac . $caveat_id_hmac;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $caveat_id_hmac is not named in camelCase. Open
public static function signThirdPartyCaveat($signature, $verificationId, $caveatId)
{
$verification_id_hmac = self::hmac($signature, $verificationId);
$caveat_id_hmac = self::hmac($signature, $caveatId);
$combined = $verification_id_hmac . $caveat_id_hmac;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The method base64_url_safe_encode is not named in camelCase. Open
public static function base64_url_safe_encode($data)
{
$data = str_replace('+', '-', self::base64_strict_encode($data));
return str_replace('/', '_', $data);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method base64_url_encode is not named in camelCase. Open
public static function base64_url_encode($data)
{
return str_replace('=', '', self::base64_url_safe_encode($data));
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method base64_url_decode is not named in camelCase. Open
public static function base64_url_decode($data)
{
return self::base64_url_safe_decode(str_pad($data, (4 - (strlen($data) % 4)) % 4, '=', STR_PAD_RIGHT));
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method base64_strict_encode is not named in camelCase. Open
public static function base64_strict_encode($data)
{
$data = str_replace("\r\n", '', base64_encode($data));
$data = str_replace("\r", '', $data);
return str_replace("\n", '', $data);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method base64_url_safe_decode is not named in camelCase. Open
public static function base64_url_safe_decode($data)
{
$data = str_replace('-', '+', $data);
$data = str_replace('_', '/', $data);
return base64_decode($data);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}