The class HtmlTemplate has an overall complexity of 82 which is very high. The configured complexity threshold is 50. Open
class HtmlTemplate
{
use WarnDynamicPropertyTrait;
public const TOP_TAG = '_top';
- Create a ticketCreate a ticket
- Exclude checks
The class HtmlTemplate has 17 public methods. Consider refactoring HtmlTemplate to keep number of public methods under 10. Open
class HtmlTemplate
{
use WarnDynamicPropertyTrait;
public const TOP_TAG = '_top';
- Read upRead up
- Create a ticketCreate a ticket
- 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
Method _setOrAppend
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function _setOrAppend($tag, ?string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
- Create a ticketCreate a ticket
The method _setOrAppend() has an NPath complexity of 960. The configured NPath complexity threshold is 200. Open
protected function _setOrAppend($tag, ?string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
{
// $tag passed as associative array [tag => value]
if (is_array($tag) && $value === null) { // @phpstan-ignore identical.alwaysFalse, booleanAnd.alwaysFalse
if ($throwIfNotFound) {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method _setOrAppend() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10. Open
protected function _setOrAppend($tag, ?string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
{
// $tag passed as associative array [tag => value]
if (is_array($tag) && $value === null) { // @phpstan-ignore identical.alwaysFalse, booleanAnd.alwaysFalse
if ($throwIfNotFound) {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method parseTemplateTree() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
protected function parseTemplateTree(array &$inputReversed, ?string $openedTag = null): TagTree
{
$tagTree = new TagTree($this, $openedTag ?? self::TOP_TAG);
$chunk = array_pop($inputReversed);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method _setOrAppend has a boolean flag argument $throwIfNotFound, which is a certain sign of a Single Responsibility Principle violation. Open
protected function _setOrAppend($tag, ?string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
- Read upRead up
- Create a ticketCreate a ticket
- 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
Remove error control operator '@' on line 408. Open
public function tryLoadFromFile(string $filename)
{
// realpath() is slow on Windows, so cache it and dedup only directories
$filenameBase = basename($filename);
$filename = dirname($filename);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
The method loadFromString has a boolean flag argument $allowParseCache, which is a certain sign of a Single Responsibility Principle violation. Open
public function loadFromString(string $str, bool $allowParseCache = false): self
- Read upRead up
- Create a ticketCreate a ticket
- 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 _setOrAppend has a boolean flag argument $append, which is a certain sign of a Single Responsibility Principle violation. Open
protected function _setOrAppend($tag, ?string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
- Read upRead up
- Create a ticketCreate a ticket
- 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 _setOrAppend has a boolean flag argument $encodeHtml, which is a certain sign of a Single Responsibility Principle violation. Open
protected function _setOrAppend($tag, ?string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
- Read upRead up
- Create a ticketCreate a ticket
- 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 _unsetFromTagTree uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
unset($tagTree->children[$k]);
}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method _setOrAppend uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$htmlValue->dangerouslySetHtml($value);
}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method emptyTagTree uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->_unsetFromTagTree($tagTree, $k);
}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Closure' in method '_unsetFromTagTree'. Open
\Closure::bind(static function () use ($tagTree, $k) {
if ($k === array_key_last($tagTree->children)) {
array_pop($tagTree->children);
} else {
unset($tagTree->children[$k]);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
The method renderTagTreeToHtml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
throw (new Exception('Unexpected value class'))
->addMoreInfo('value_class', get_class($v));
}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Closure' in method 'cloneRegion'. Open
\Closure::bind(static function () use ($topTagTree, $topTag) {
$topTagTree->tag = $topTag;
}, null, TagTree::class)();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 '\Closure' in method 'del'. Open
\Closure::bind(static function () use ($tagTree) {
$tagTree->children = [];
}, null, TagTree::class)();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
The method toLoadableString uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
throw (new Exception('Value class has no save support'))
->addMoreInfo('value_class', get_class($v));
}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Closure' in method 'parseTemplate'. Open
\Closure::bind(static function () use ($tagTrees, $parentTemplate) {
foreach ($tagTrees as $tagTree) {
$tagTree->parentTemplate = $parentTemplate;
}
}, null, TagTree::class)();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 excessively long variable names like $_parseCacheParentTemplate. Keep variable name length under 20. Open
private static ?self $_parseCacheParentTemplate = null;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid variables with short names like $k. Configured minimum length is 3. Open
protected function _unsetFromTagTree(TagTree $tagTree, int $k): void
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The property $_realpathCache is not named in camelCase. Open
class HtmlTemplate
{
use WarnDynamicPropertyTrait;
public const TOP_TAG = '_top';
- Read upRead up
- Create a ticketCreate a ticket
- 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
The property $_filesCache is not named in camelCase. Open
class HtmlTemplate
{
use WarnDynamicPropertyTrait;
public const TOP_TAG = '_top';
- Read upRead up
- Create a ticketCreate a ticket
- 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
The property $_parseCache is not named in camelCase. Open
class HtmlTemplate
{
use WarnDynamicPropertyTrait;
public const TOP_TAG = '_top';
- Read upRead up
- Create a ticketCreate a ticket
- 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
The property $_parseCacheParentTemplate is not named in camelCase. Open
class HtmlTemplate
{
use WarnDynamicPropertyTrait;
public const TOP_TAG = '_top';
- Read upRead up
- Create a ticketCreate a ticket
- 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
Method name "_unsetFromTagTree" should not be prefixed with an underscore to indicate visibility Open
protected function _unsetFromTagTree(TagTree $tagTree, int $k): void
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_filesCache" should not be prefixed with an underscore to indicate visibility Open
private static array $_filesCache = [];
- Create a ticketCreate a ticket
- Exclude checks
Method name "_hasTag" should not be prefixed with an underscore to indicate visibility Open
protected function _hasTag(string $tag): bool
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_parseCacheParentTemplate" should not be prefixed with an underscore to indicate visibility Open
private static ?self $_parseCacheParentTemplate = null;
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_realpathCache" should not be prefixed with an underscore to indicate visibility Open
private static array $_realpathCache = [];
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_parseCache" should not be prefixed with an underscore to indicate visibility Open
private static array $_parseCache = [];
- Create a ticketCreate a ticket
- Exclude checks
Method name "_setOrAppend" should not be prefixed with an underscore to indicate visibility Open
protected function _setOrAppend($tag, ?string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
protected function _setOrAppend($tag, ?string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
- Create a ticketCreate a ticket
- Exclude checks
The variable $_parseCache is not named in camelCase. Open
protected function parseTemplate(string $str, bool $allowParseCache): void
{
$cKey = static::class . "\0" . $str;
if (!isset(self::$_parseCache[$cKey])) {
// expand self-closing tags {$tag} -> {tag}{/tag}
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_parseCache is not named in camelCase. Open
protected function parseTemplate(string $str, bool $allowParseCache): void
{
$cKey = static::class . "\0" . $str;
if (!isset(self::$_parseCache[$cKey])) {
// expand self-closing tags {$tag} -> {tag}{/tag}
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_filesCache is not named in camelCase. Open
public function tryLoadFromFile(string $filename)
{
// realpath() is slow on Windows, so cache it and dedup only directories
$filenameBase = basename($filename);
$filename = dirname($filename);
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_realpathCache is not named in camelCase. Open
public function tryLoadFromFile(string $filename)
{
// realpath() is slow on Windows, so cache it and dedup only directories
$filenameBase = basename($filename);
$filename = dirname($filename);
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_parseCache is not named in camelCase. Open
protected function parseTemplate(string $str, bool $allowParseCache): void
{
$cKey = static::class . "\0" . $str;
if (!isset(self::$_parseCache[$cKey])) {
// expand self-closing tags {$tag} -> {tag}{/tag}
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_parseCache is not named in camelCase. Open
protected function parseTemplate(string $str, bool $allowParseCache): void
{
$cKey = static::class . "\0" . $str;
if (!isset(self::$_parseCache[$cKey])) {
// expand self-closing tags {$tag} -> {tag}{/tag}
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_realpathCache is not named in camelCase. Open
public function tryLoadFromFile(string $filename)
{
// realpath() is slow on Windows, so cache it and dedup only directories
$filenameBase = basename($filename);
$filename = dirname($filename);
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_filesCache is not named in camelCase. Open
public function tryLoadFromFile(string $filename)
{
// realpath() is slow on Windows, so cache it and dedup only directories
$filenameBase = basename($filename);
$filename = dirname($filename);
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_realpathCache is not named in camelCase. Open
public function tryLoadFromFile(string $filename)
{
// realpath() is slow on Windows, so cache it and dedup only directories
$filenameBase = basename($filename);
$filename = dirname($filename);
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_filesCache is not named in camelCase. Open
public function tryLoadFromFile(string $filename)
{
// realpath() is slow on Windows, so cache it and dedup only directories
$filenameBase = basename($filename);
$filename = dirname($filename);
- Read upRead up
- Create a ticketCreate a ticket
- 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 $_parseCache is not named in camelCase. Open
protected function parseTemplate(string $str, bool $allowParseCache): void
{
$cKey = static::class . "\0" . $str;
if (!isset(self::$_parseCache[$cKey])) {
// expand self-closing tags {$tag} -> {tag}{/tag}
- Read upRead up
- Create a ticketCreate a ticket
- 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 _setOrAppend is not named in camelCase. Open
protected function _setOrAppend($tag, ?string $value = null, bool $encodeHtml = true, bool $append = false, bool $throwIfNotFound = true): void
{
// $tag passed as associative array [tag => value]
if (is_array($tag) && $value === null) { // @phpstan-ignore identical.alwaysFalse, booleanAnd.alwaysFalse
if ($throwIfNotFound) {
- Read upRead up
- Create a ticketCreate a ticket
- 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 _hasTag is not named in camelCase. Open
protected function _hasTag(string $tag): bool
{
return isset($this->tagTrees[$tag]);
}
- Read upRead up
- Create a ticketCreate a ticket
- 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 _unsetFromTagTree is not named in camelCase. Open
protected function _unsetFromTagTree(TagTree $tagTree, int $k): void
{
\Closure::bind(static function () use ($tagTree, $k) {
if ($k === array_key_last($tagTree->children)) {
array_pop($tagTree->children);
- Read upRead up
- Create a ticketCreate a ticket
- 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() {
}
}