src/Table.php

Summary

Maintainability
A
0 mins
Test Coverage

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';
Severity: Minor
Found in src/Table.php by phpmd

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';
Severity: Minor
Found in src/Table.php by phpmd

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 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';
Severity: Minor
Found in src/Table.php by phpmd

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);
Severity: Minor
Found in src/Table.php by phpmd

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)) {
Severity: Minor
Found in src/Table.php by phpmd

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);
Severity: Minor
Found in src/Table.php by phpmd

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';
Severity: Minor
Found in src/Table.php by phpmd

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

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]
Severity: Minor
Found in src/Table.php by phpmd

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 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);
                }
Severity: Minor
Found in src/Table.php by phpmd

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]));
Severity: Minor
Found in src/Table.php by phpmd

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 '_addUnchecked'.
Open

        return \Closure::bind(function () use ($column) {
            return $this->_add($column);
        }, $this, AbstractView::class)();
Severity: Minor
Found in src/Table.php by phpmd

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 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();
            }
Severity: Minor
Found in src/Table.php by phpmd

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 'addDecorator'.
Open

        $decorator = $this->_addUnchecked(Table\Column::fromSeed($seed, ['table' => $this]));
Severity: Minor
Found in src/Table.php by phpmd

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);
Severity: Minor
Found in src/Table.php by phpmd

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();
Severity: Minor
Found in src/Table.php by phpmd

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]));
        }
Severity: Minor
Found in src/Table.php by phpmd

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 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());
        }
Severity: Minor
Found in src/Table.php by phpmd

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 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);
        }
Severity: Minor
Found in src/Table.php by phpmd

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 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;
        }
Severity: Minor
Found in src/Table.php by phpmd

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 'decoratorFactory'.
Open

        return $this->_addUnchecked(Table\Column::fromSeed($seed, ['table' => $this]));
Severity: Minor
Found in src/Table.php by phpmd

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 'addColumn'.
Open

            $columnDecorator = $this->_addUnchecked(Table\Column::fromSeed($columnDecorator, ['table' => $this]));
Severity: Minor
Found in src/Table.php by phpmd

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 $hasCollapsingCssActionColumn. Keep variable name length under 20.
Open

    public $hasCollapsingCssActionColumn = true;
Severity: Minor
Found in src/Table.php by phpmd

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
Severity: Minor
Found in src/Table.php by phpcodesniffer

Avoid variables with short names like $f. Configured minimum length is 3.
Open

                $f = $val[0];
Severity: Minor
Found in src/Table.php by phpmd

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 $ui. Configured minimum length is 3.
Open

    public $ui = 'table';
Severity: Minor
Found in src/Table.php by phpmd

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);
Severity: Minor
Found in src/Table.php by phpmd

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
Severity: Minor
Found in src/Table.php by phpmd

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, $resizerOptions = [])
Severity: Minor
Found in src/Table.php by phpmd

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
Severity: Minor
Found in src/Table.php by phpcodesniffer

Possible parse error: class missing opening or closing brace
Open

class Table extends Lister
Severity: Minor
Found in src/Table.php by phpcodesniffer

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)
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line exceeds 120 characters; contains 127 characters
Open

            $columnDecorator = $this->decoratorFactory($field, Factory::mergeSeeds($columnDecorator, ['columnData' => $name]));
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line exceeds 120 characters; contains 122 characters
Open

        $this->tRow->trySet($this->getApp()->uiPersistence->typecastSaveRow($this->currentRow, $this->currentRow->get()));
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line exceeds 120 characters; contains 155 characters
Open

            $this->tRow->set('dataId', $this->getApp()->uiPersistence->typecastAttributeSaveField($this->model->getIdField(), $this->currentRow->getId()));
Severity: Minor
Found in src/Table.php by phpcodesniffer

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.
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line exceeds 120 characters; contains 145 characters
Open

    /** @var array<int|string, Table\Column|array<int, Table\Column>> Contains list of declared columns. Value will always be a column object. */
Severity: Minor
Found in src/Table.php by phpcodesniffer

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
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line exceeds 120 characters; contains 170 characters
Open

     * @param array                                                        $resizerOptions column-resizer module options, see https://www.npmjs.com/package/column-resizer
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line exceeds 120 characters; contains 142 characters
Open

                    || (elem.classList.contains('ui') && ['button', 'input', 'checkbox', 'dropdown'].some(v => elem.classList.contains(v)))) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

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']));
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function resizableColumn($fx = null, $widths = null, $resizerOptions = [])
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($fx !== null) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($widths !== null) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                if (is_array($ret)) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $useHtmlTags = true;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $tHead;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        foreach ($fields as $field) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        } else {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $tRow;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $tTotals;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        } else {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($this->model === null) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    protected array $typeToDecorator = [
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if (!is_array($this->columns[$name])) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if (!$this->columns) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($this->sortable) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                if ($this->hook(self::HOOK_BEFORE_ROW) === false) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $header = true;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if (!$this->tHead) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        } elseif (!$this->model->hasField($name)) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            foreach ($this->model->getFields() as $key => $field) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                if (!is_array($columns)) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if (!$cols) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        foreach ($cols as $colName) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                if ($this->hook(self::HOOK_AFTER_ROW) === false) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $ui = 'table';
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function setFilterColumn($cols = null): void
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    protected function getColumn(string $name)
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function addTotals($plan = []): void
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                foreach ($columns as $column) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $sortable;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function getColumnDecorators(string $name): array
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($fields === null) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function onRowClick($action): void
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $sortDirection;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        } else {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if ($pop->isFilterOn()) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $reload;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $totalsPlan = false;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                if (isset($this->columns[$key])) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if (!isset($this->columns[$name])) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function renderRow(): void
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $totals = [];
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $hasCollapsingCssActionColumn = true;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($name !== null && isset($this->columns[$name])) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }, $this, AbstractView::class)();
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function addDecorator(string $name, $seed)
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function decoratorFactory(Field $field, $seed = [])
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function addJsPaginator($ipp, $options = [], $container = null, $scrollRegion = 'Body')
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($this->_renderedRowsCount === 0) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            foreach ($this->columns as $name => $columns) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $defaultTemplate = 'table.html';
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $columns = [];
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($this->useHtmlTags) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $tRowMaster;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($this->model === null) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($name === null) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($field === null) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        try {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            foreach ($this->model as $entity) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        } finally {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public $sortBy;
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    protected function initChunks(): void
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    private function _addUnchecked(Table\Column $column): Table\Column
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    protected function renderView(): void
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($name === null) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 12 spaces, found 16
Open

                if ($this->totalsPlan) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (!$this->jsPaginator || !$this->jsPaginator->getPage()) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function setModel(Model $model, ?array $fields = null): void
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            foreach ($this->hook(Table\Column::HOOK_GET_HTML_TAGS, [$this->currentRow]) as $ret) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    public function addColumn(?string $name, $columnDecorator = [], $field = [])
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        } else {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }, ['widths' => 'widths']);
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($this->header) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        } elseif ($this->totalsPlan) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        if ($this->jsPaginator && ($this->_renderedRowsCount < $this->ipp)) {
Severity: Minor
Found in src/Table.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in src/Table.php by phpcodesniffer

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)();
Severity: Minor
Found in src/Table.php by phpmd

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

There are no issues that match your filters.

Category
Status