getCachedEtag accesses the super-global variable $_SESSION. Open
public function getCachedEtag()
{
return isset($_SESSION[$this->getsKeyEtag()]) ? \base64_decode(\unserialize($_SESSION[$this->getsKeyEtag()]), true) : false;
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
execCurl accesses the super-global variable $_SESSION. Open
public function execCurl(): int
{
$curl = \curl_init($this->getServiceUrl());
\curl_setopt_array(
$curl,
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
getCachedEtag accesses the super-global variable $_SESSION. Open
public function getCachedEtag()
{
return isset($_SESSION[$this->getsKeyEtag()]) ? \base64_decode(\unserialize($_SESSION[$this->getsKeyEtag()]), true) : false;
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
execCurl accesses the super-global variable $_SESSION. Open
public function execCurl(): int
{
$curl = \curl_init($this->getServiceUrl());
\curl_setopt_array(
$curl,
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
execCurl accesses the super-global variable $_SESSION. Open
public function execCurl(): int
{
$curl = \curl_init($this->getServiceUrl());
\curl_setopt_array(
$curl,
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Method execCurl
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execCurl(): int
{
$curl = \curl_init($this->getServiceUrl());
\curl_setopt_array(
$curl,
The method getCurlResponse has a boolean flag argument $serialized, which is a certain sign of a Single Responsibility Principle violation. Open
public function getCurlResponse(bool $serialized = false): string
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method getHeaderFromArray has a boolean flag argument $asArray, which is a certain sign of a Single Responsibility Principle violation. Open
public function getHeaderFromArray(string $hdr, bool $asArray = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid unused parameters such as '$curl'. Open
public function handleHeaderLine($curl, string $hdrLine): int
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
The property $curl_response is not named in camelCase. Open
class Issues
{
/**
* @var array
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Line exceeds 120 characters; contains 132 characters Open
return isset($_SESSION[$this->getsKeyEtag()]) ? \base64_decode(\unserialize($_SESSION[$this->getsKeyEtag()]), true) : false;
- Exclude checks
Line exceeds 120 characters; contains 163 characters Open
//declare(strict_types=1); //mb do not use it here, as it generates conflict on line 280: base64_encode(): Argument #1 ($string) must be of type string, bool given
- Exclude checks