YetiForceCompany/YetiForcePDF

View on GitHub
lib/Layout/TableWrapperBox.php

Summary

Maintainability
A
0 mins
Test Coverage

The method measureWidth has a boolean flag argument $afterPageDividing, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function measureWidth(bool $afterPageDividing = false)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

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

Missing class import via use statement (line '85', column '22').
Open

        $cleanStyle = (new \YetiForcePDF\Style\Style())->setDocument($this->document);
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The method measureHeight has a boolean flag argument $afterPageDividing, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function measureHeight(bool $afterPageDividing = false)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Avoid using static access to class '\YetiForcePDF\Math' in method 'measureHeight'.
Open

            $maxHeight = Math::max($maxHeight, $child->getDimensions()->getHeight());
Severity: Minor
Found in lib/Layout/TableWrapperBox.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 '\YetiForcePDF\Math' in method 'measureHeight'.
Open

        $maxHeight = Math::add($maxHeight, $style->getVerticalBordersWidth(), $style->getVerticalPaddingsWidth());
Severity: Minor
Found in lib/Layout/TableWrapperBox.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 unused parameters such as '$childDomElement'.
Open

    public function appendTableWrapperBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$parentBlock'.
Open

    public function appendInlineBlockBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$childDomElement'.
Open

    public function appendInlineBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$element'.
Open

    public function appendBlockBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$childDomElement'.
Open

    public function appendInlineBlockBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$element'.
Open

    public function appendTableWrapperBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$parentBlock'.
Open

    public function appendTableWrapperBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$element'.
Open

    public function appendInlineBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$childDomElement'.
Open

    public function appendTableBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$style'.
Open

    public function appendTableBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$style'.
Open

    public function appendTableWrapperBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$element'.
Open

    public function appendInlineBlockBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$childDomElement'.
Open

    public function appendBlockBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$parentBlock'.
Open

    public function appendInlineBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$style'.
Open

    public function appendBlockBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$style'.
Open

    public function appendInlineBlockBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$parentBlock'.
Open

    public function appendTableBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$style'.
Open

    public function appendInlineBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$parentBlock'.
Open

    public function appendBlockBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$element'.
Open

    public function appendTableBox($childDomElement, $element, $style, $parentBlock)
Severity: Minor
Found in lib/Layout/TableWrapperBox.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * We shouldn't append table wrapper here.

Spaces must be used to indent lines; tabs are not allowed
Open

        $cleanStyle = (new \YetiForcePDF\Style\Style())->setDocument($this->document);

Spaces must be used to indent lines; tabs are not allowed
Open

        $cleanStyle->setRule('display', 'block');

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

            $child->measureWidth($afterPageDividing);

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->getDimensions()->setHeight($maxHeight);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $childDomElement

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $style

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    public function appendInlineBox($childDomElement, $element, $style, $parentBlock)

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param Element                       $element

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param Style                         $style

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($this->getChildren() as $child) {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $element

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $parentBlock

Spaces must be used to indent lines; tabs are not allowed
Open

     * Append table box element.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

            ->setDocument($this->document)

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * {@inheritdoc}

Spaces must be used to indent lines; tabs are not allowed
Open

            return $this;

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->applyStyleWidth();

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $childDomElement

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $style

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \DOMNode                      $childDomElement

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return $this

Spaces must be used to indent lines; tabs are not allowed
Open

            ->setStyle($cleanStyle)

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     * We shouldn't append inline block box here.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $parentBlock

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $parentBlock

Spaces must be used to indent lines; tabs are not allowed
Open

            $child->measureHeight($afterPageDividing);

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

            ->setParent($this)

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $parentBlock

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $style

Spaces must be used to indent lines; tabs are not allowed
Open

    public function appendInlineBlockBox($childDomElement, $element, $style, $parentBlock)

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    public function appendTableBox($childDomElement, $element, $style, $parentBlock)

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $element

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \YetiForcePDF\Layout\BlockBox $parentBlock

Spaces must be used to indent lines; tabs are not allowed
Open

    public function measureHeight(bool $afterPageDividing = false)

Spaces must be used to indent lines; tabs are not allowed
Open

            $child->measureHeight($afterPageDividing);

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $childDomElement

Spaces must be used to indent lines; tabs are not allowed
Open

    public function measureWidth(bool $afterPageDividing = false)

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->applyStyleWidth();

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($this->getChildren() as $child) {

Spaces must be used to indent lines; tabs are not allowed
Open

        $style = $this->getStyle();

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this;

Spaces must be used to indent lines; tabs are not allowed
Open

    public function appendTableWrapperBox($childDomElement, $element, $style, $parentBlock)

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $box = (new TableBox())

Spaces must be used to indent lines; tabs are not allowed
Open

            ->init();

Spaces must be used to indent lines; tabs are not allowed
Open

        $box->getStyle()->init()->setRule('display', 'block');

Spaces must be used to indent lines; tabs are not allowed
Open

        $box->buildTree($box);

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $element

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        return $box;

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this;

Spaces must be used to indent lines; tabs are not allowed
Open

            $maxHeight = Math::max($maxHeight, $child->getDimensions()->getHeight());

Spaces must be used to indent lines; tabs are not allowed
Open

     * We shouldn't append block box here.

Spaces must be used to indent lines; tabs are not allowed
Open

    public function appendBlockBox($childDomElement, $element, $style, $parentBlock)

Spaces must be used to indent lines; tabs are not allowed
Open

     * {@inheritdoc}

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * We shouldn't append inline box here.

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->appendChild($box);

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($this->getChildren() as $child) {

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($this->wasCut()) {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $childDomElement

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $style

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed $element

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

            //->setElement($element)

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        $maxHeight = '0';

Spaces must be used to indent lines; tabs are not allowed
Open

        $maxHeight = Math::add($maxHeight, $style->getVerticalBordersWidth(), $style->getVerticalPaddingsWidth());

There are no issues that match your filters.

Category
Status