Showing 1,364 of 1,364 total issues
Opening brace should be on a new line Open
public function filter($in, $out, &$consumed, $closing) {
- Exclude checks
Opening brace should be on a new line Open
public function filter($in, $out, &$consumed, $closing) {
- Exclude checks
Opening brace should be on a new line Open
protected function __construct() {
- Exclude checks
Opening brace should be on a new line Open
public function filter($in, $out, &$consumed, $closing) {
- Exclude checks
Opening brace should be on a new line Open
public function filter($in, $out, &$consumed, $closing) {
- Exclude checks
Opening brace should be on a new line Open
public function filter($in, $out, &$consumed, $closing) {
- Exclude checks
Opening brace should be on a new line Open
public function filter($in, $out, &$consumed, $closing) {
- Exclude checks
Opening brace should be on a new line Open
public function getContentIterated(): \Generator {
- Exclude checks
Opening brace should be on a new line Open
public function getContentRaw(): string {
- Exclude checks
Opening brace should be on a new line Open
public static function fromStream($stream): self {
- Exclude checks
Opening brace should be on a new line Open
public static function fromString(string $input = ''): self {
- Exclude checks
Opening brace should be on a new line Open
public function __destruct() {
- Exclude checks
Opening brace should be on a new line Open
public function setEncoding(string $encoding) {
- Exclude checks
Opening brace should be on a new line Open
protected function setStream($stream): GeneratorBasedReader {
- Exclude checks
The variable $error_msg is not named in camelCase. Open
private function checkHostRule($rule) {
if (!isset($this->url)) {
$error_msg = WarmingMessages::INLINED_HOST;
$this->log($error_msg, [], LogLevel::ERROR);
return false;
- 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 $error_msg is not named in camelCase. Open
private function checkHostRule($rule) {
if (!isset($this->url)) {
$error_msg = WarmingMessages::INLINED_HOST;
$this->log($error_msg, [], LogLevel::ERROR);
return false;
- 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
Define a constant instead of duplicating this literal "logger" 3 times. Open
&& isset($this->params['logger'])
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "logger" 3 times. Open
&& isset($this->params['logger'])
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "{useragent}" 3 times. Open
'{useragent}' => $currentUserAgent,
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "logger" 5 times. Open
if (isset($this->params['logger']) && $this->params['logger'] instanceof LoggerInterface) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.