The class Table has 11 public methods. Consider refactoring Table to keep number of public methods under 10. Open
class Table extends Lister
{
public $ui = 'table';
public $defaultTemplate = 'table.html';
- 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
The class Table has an overall complexity of 87 which is very high. The configured complexity threshold is 50. Open
class Table extends Lister
{
public $ui = 'table';
public $defaultTemplate = 'table.html';
- Create a ticketCreate a ticket
- Exclude checks
The class Table has 17 fields. Consider redesigning Table to keep the number of fields under 15. Wontfix
class Table extends Lister
{
public $ui = 'table';
public $defaultTemplate = 'table.html';
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
The method renderView() has an NPath complexity of 1200. The configured NPath complexity threshold is 200. Open
protected function renderView(): void
{
if (!$this->columns) {
throw (new Exception('Table does not have any columns defined'))
->addMoreInfo('columns', $this->columns);
- 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 updateTotals() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. Open
public function updateTotals(): void
{
foreach ($this->totalsPlan as $key => $val) {
// if value is array, then we treat it as built-in or closure aggregate method
if (is_array($val)) {
- 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 renderView() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. Open
protected function renderView(): void
{
if (!$this->columns) {
throw (new Exception('Table does not have any columns defined'))
->addMoreInfo('columns', $this->columns);
- 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 class Table has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13. Open
class Table extends Lister
{
public $ui = 'table';
public $defaultTemplate = 'table.html';
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
The method addColumn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->columns[$name] = $columnDecorator;
}
- 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 getHeaderRowHtml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$output[] = $column->getHeaderCellHtml();
}
- 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 '\Atk4\Core\Factory' in method 'addColumn'. Open
$columnDecorator = $this->decoratorFactory($field, Factory::mergeSeeds($columnDecorator, ['columnData' => $name]));
- 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 'Atk4\Ui\Table\Column' in method 'decoratorFactory'. Open
return $this->_addUnchecked(Table\Column::fromSeed($seed, ['table' => $this]));
- 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 addColumn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$field = $this->model->getField($name)
->setDefaults($field);
}
- 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 getDataRowHtml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// last formatter, ask it to give us whole rendering
$html = $c->getDataCellHtml($field, $tdAttr);
}
- 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 'Atk4\Ui\Table\Column' in method 'addColumn'. Open
$columnDecorator = $this->_addUnchecked(Table\Column::fromSeed($columnDecorator, ['table' => $this]));
- 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 'Atk4\Ui\JsCallback' in method 'resizableColumn'. Open
$cb = JsCallback::addTo($this);
- 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 'Atk4\Ui\View' in method 'renderView'. Open
View::renderView();
- 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 'Atk4\Ui\Table\Column' in method 'addDecorator'. Open
$decorator = $this->_addUnchecked(Table\Column::fromSeed($seed, ['table' => $this]));
- 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 addColumn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$columnDecorator = $this->decoratorFactory($field, Factory::mergeSeeds($columnDecorator, ['columnData' => $name]));
}
- 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 '_addUnchecked'. Open
return \Closure::bind(function () use ($column) {
return $this->_add($column);
}, $this, AbstractView::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 '\Atk4\Core\Factory' in method 'decoratorFactory'. Open
$seed = Factory::mergeSeeds(
$seed,
$field->ui['table'] ?? null,
$this->typeToDecorator[$field->type] ?? null,
[Table\Column::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 renderRow uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->template->dangerouslyAppendHtml('Body', $this->tRow->renderToHtml());
}
- 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 excessively long variable names like $hasCollapsingCssActionColumn. Keep variable name length under 20. Open
public $hasCollapsingCssActionColumn = true;
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 103 and the first side effect is on line 18. Open
<?php
- Create a ticketCreate a ticket
- Exclude checks
Avoid variables with short names like $ui. Configured minimum length is 3. Open
public $ui = 'table';
- 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
Avoid variables with short names like $fx. Configured minimum length is 3. Open
public function resizableColumn($fx = null, $widths = null, array $resizerOptions = [])
- 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
Avoid variables with short names like $cb. Configured minimum length is 3. Open
$cb = JsCallback::addTo($this);
- 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
Avoid variables with short names like $id. Configured minimum length is 3. Open
public function jsRemoveRow($id, $transition = 'fade left'): JsExpressionable
- 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
Avoid variables with short names like $f. Configured minimum length is 3. Open
$f = $val[0];
- 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
Possible parse error: class missing opening or closing brace Open
class Table extends Lister
- Create a ticketCreate a ticket
- Exclude checks
Possible parse error: class missing opening or closing brace Open
class Table extends Lister
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
* @param \Closure(Jquery, mixed): (JsExpressionable|View|string|void) $fx a callback function with columns widths as parameter
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 180 characters Open
$pop = $col->addPopup(new Table\Column\FilterPopup(['field' => $this->model->getField($colName), 'reload' => $this->reload, 'colTrigger' => '#' . $col->name . '_ac']));
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
$this->tRow->set('dataId', $this->getApp()->uiPersistence->typecastAttributeSaveField($this->model->getIdField(), $this->currentRow->getId()));
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 139 characters Open
/** @var array<int|string, Table\Column|list<Table\Column>> Contains list of declared columns. Value will always be a column object. */
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$this->tRow->trySet($this->getApp()->uiPersistence->typecastSaveRow($this->currentRow, $this->currentRow->get()));
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 142 characters Open
|| (elem.classList.contains('ui') && ['button', 'input', 'checkbox', 'dropdown'].some(v => elem.classList.contains(v)))) {
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
// contain the column instance anymore but an array with column instance set at 0 indexes and the rest as decorators.
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
* @phpstan-type JsCallbackSetClosure \Closure(Jquery, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed): (JsExpressionable|View|string|void)
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 170 characters Open
* @param array<string, mixed> $resizerOptions column-resizer module options, see https://www.npmjs.com/package/column-resizer
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
$columnDecorator = $this->decoratorFactory($field, Factory::mergeSeeds($columnDecorator, ['columnData' => $name]));
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $defaultTemplate = 'table.html';
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $columns = [];
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $hasCollapsingCssActionColumn = true;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function addJsPaginator($ipp, array $options = [], $container = null, $scrollRegion = 'Body')
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
protected function renderView(): void
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if (!$this->columns) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
} elseif ($this->totalsPlan) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($this->jsPaginator && ($this->_renderedRowsCount < $this->ipp)) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
protected function initChunks(): void
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function addColumn(?string $name, $columnDecorator = [], $field = [])
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
} else {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function decoratorFactory(Field $field, $seed = [])
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $tHead;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $sortBy;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
foreach ($this->model->getFields() as $key => $field) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($widths !== null) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if (!$cols) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function renderRow(): void
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($this->useHtmlTags) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function getColumnDecorators(string $name): array
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($fx !== null) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($this->sortable) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
try {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if ($this->totalsPlan) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $sortable;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
foreach ($cols as $colName) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
foreach ($this->hook(Table\Column::HOOK_GET_HTML_TAGS, [$this->currentRow]) as $ret) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function onRowClick($action): void
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $reload;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
} elseif (!$this->model->hasField($name)) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
} else {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
private function _addUnchecked(Table\Column $column): Table\Column
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($this->header) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $tRow;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}, $this, AbstractView::class)();
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
protected array $typeToDecorator = [
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($name === null) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function setFilterColumn($cols = null): void
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($this->model === null) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if (!isset($this->columns[$name])) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
foreach ($this->columns as $name => $columns) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if ($this->hook(self::HOOK_AFTER_ROW) === false) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $tRowMaster;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($field === null) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if (isset($this->columns[$key])) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
foreach ($fields as $field) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
foreach ($this->model as $entity) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $totalsPlan = false;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function addTotals($plan = []): void
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if (!is_array($columns)) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($fields === null) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
} else {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
foreach ($columns as $column) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($name === null) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if (!is_array($this->columns[$name])) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
} finally {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $header = true;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function addDecorator(string $name, $seed)
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}, ['widths' => 'widths']);
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $totals = [];
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($name !== null && isset($this->columns[$name])) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($this->model === null) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if ($this->hook(self::HOOK_BEFORE_ROW) === false) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if (is_array($ret)) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $ui = 'table';
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $tTotals;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if (!$this->tHead) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $useHtmlTags = true;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public $sortDirection;
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
} else {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
if ($pop->isFilterOn()) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
protected function getColumn(string $name)
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function resizableColumn($fx = null, $widths = null, array $resizerOptions = [])
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function setModel(Model $model, ?array $fields = null): void
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
if (!$this->jsPaginator || !$this->jsPaginator->getPage()) {
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
if ($this->_renderedRowsCount === 0) {
- Create a ticketCreate a ticket
- Exclude checks
The method _addUnchecked is not named in camelCase. Open
private function _addUnchecked(Table\Column $column): Table\Column
{
return \Closure::bind(function () use ($column) {
return $this->_add($column);
}, $this, AbstractView::class)();
- 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() {
}
}