YetiForceCompany/YetiForcePDF

View on GitHub
lib/Layout/Dimensions/BoxDimensions.php

Summary

Maintainability
D
2 days
Test Coverage

Function getOuterWidth has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOuterWidth()
    {
        $box = $this->getBox();
        if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
            return '0';
Severity: Minor
Found in lib/Layout/Dimensions/BoxDimensions.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File BoxDimensions.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);
/**
 * BoxDimensions class.
Severity: Minor
Found in lib/Layout/Dimensions/BoxDimensions.php - About 3 hrs to fix

    Function getMaxWidth has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getMaxWidth()
        {
            $box = $this->getBox();
            if (!$box->isForMeasurement()) {
                return '0';
    Severity: Minor
    Found in lib/Layout/Dimensions/BoxDimensions.php - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    The class BoxDimensions has an overall complexity of 86 which is very high. The configured complexity threshold is 50.
    Open

    class BoxDimensions extends Dimensions
    {
        /**
         * @var Box
         */

    Function getOuterHeight has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getOuterHeight()
        {
            $box = $this->getBox();
            if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
                return '0';
    Severity: Minor
    Found in lib/Layout/Dimensions/BoxDimensions.php - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method getOuterWidth has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getOuterWidth()
        {
            $box = $this->getBox();
            if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
                return '0';
    Severity: Minor
    Found in lib/Layout/Dimensions/BoxDimensions.php - About 1 hr to fix

      Method getMaxWidth has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getMaxWidth()
          {
              $box = $this->getBox();
              if (!$box->isForMeasurement()) {
                  return '0';
      Severity: Minor
      Found in lib/Layout/Dimensions/BoxDimensions.php - About 1 hr to fix

        Function getStyleWidth has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getStyleWidth()
            {
                if (!$this->getBox()->isForMeasurement() && !$this->getBox()) {
                    return '0';
                }
        Severity: Minor
        Found in lib/Layout/Dimensions/BoxDimensions.php - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method getOuterHeight has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getOuterHeight()
            {
                $box = $this->getBox();
                if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
                    return '0';
        Severity: Minor
        Found in lib/Layout/Dimensions/BoxDimensions.php - About 1 hr to fix

          Function getStyleHeight has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getStyleHeight()
              {
                  if (!$this->getBox()->isForMeasurement()) {
                      return '0';
                  }
          Severity: Minor
          Found in lib/Layout/Dimensions/BoxDimensions.php - About 55 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function getMinWidth has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getMinWidth()
              {
                  $box = $this->getBox();
                  if (!$box->isForMeasurement()) {
                      return '0';
          Severity: Minor
          Found in lib/Layout/Dimensions/BoxDimensions.php - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Avoid too many return statements within this method.
          Open

                  return $this->getBox()->getChildrenWidth();
          Severity: Major
          Found in lib/Layout/Dimensions/BoxDimensions.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return Math::add($this->getHeight(), $style->getHorizontalMarginsWidth());
            Severity: Major
            Found in lib/Layout/Dimensions/BoxDimensions.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return null;
              Severity: Major
              Found in lib/Layout/Dimensions/BoxDimensions.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return null;
                Severity: Major
                Found in lib/Layout/Dimensions/BoxDimensions.php - About 30 mins to fix

                  Function getInnerHeight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getInnerHeight(): string
                      {
                          $box = $this->getBox();
                          if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
                              return '0';
                  Severity: Minor
                  Found in lib/Layout/Dimensions/BoxDimensions.php - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  The method getMaxWidth() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function getMaxWidth()
                      {
                          $box = $this->getBox();
                          if (!$box->isForMeasurement()) {
                              return '0';

                  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 getOuterWidth() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function getOuterWidth()
                      {
                          $box = $this->getBox();
                          if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
                              return '0';

                  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

                  Reduce the number of returns of this function 4, down to the maximum allowed 3.
                  Open

                      public function getMaxWidth()

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

                  Reduce the number of returns of this function 4, down to the maximum allowed 3.
                  Open

                      public function getInnerWidth(): string

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

                  Reduce the number of returns of this function 4, down to the maximum allowed 3.
                  Open

                      public function getMinWidth()

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

                  Refactor this function to reduce its Cognitive Complexity from 24 to the 15 allowed.
                  Open

                      public function getMaxWidth()

                  Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                  See

                  Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
                  Open

                      public function getOuterWidth()

                  Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                  See

                  Reduce the number of returns of this function 5, down to the maximum allowed 3.
                  Open

                      public function getStyleWidth()

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

                  Reduce the number of returns of this function 5, down to the maximum allowed 3.
                  Open

                      public function getStyleHeight()

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

                  Reduce the number of returns of this function 4, down to the maximum allowed 3.
                  Open

                      public function computeAvailableSpace()

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

                  Reduce the number of returns of this function 5, down to the maximum allowed 3.
                  Open

                      public function getOuterWidth()

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

                  Reduce the number of returns of this function 5, down to the maximum allowed 3.
                  Open

                      public function getOuterHeight()

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

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

                                      $childrenHeight = Math::add($childrenHeight, $child->getDimensions()->getOuterHeight());

                  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 assigning values to variables in if clauses and the like (line '379', column '7').
                  Open

                      public function computeAvailableSpace()
                      {
                          if (!$this->getBox()->isForMeasurement()) {
                              return '0';
                          }

                  IfStatementAssignment

                  Since: 2.7.0

                  Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($foo = 'bar') { // possible typo
                              // ...
                          }
                          if ($baz = 0) { // always false
                              // ...
                          }
                      }
                  }

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

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

                                  $width = Math::add($this->getWidth(), $style->getHorizontalMarginsWidth());

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

                                          $childrenWidth = Math::max($childrenWidth, $childWidth);

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

                                  $maxTextWidth = Math::max($maxTextWidth, $minWidth);

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

                                  $parentWidth = Math::sub($parentWidth, $style->getHorizontalMarginsWidth());

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

                                  $height = Math::add($this->getHeight(), $style->getVerticalMarginsWidth());

                  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 assigning values to variables in if clauses and the like (line '171', column '10').
                  Open

                      public function getOuterWidth()
                      {
                          $box = $this->getBox();
                          if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
                              return '0';

                  IfStatementAssignment

                  Since: 2.7.0

                  Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($foo = 'bar') { // possible typo
                              // ...
                          }
                          if ($baz = 0) { // always false
                              // ...
                          }
                      }
                  }

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

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

                                  return Math::max($width, $childrenWidth);

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

                                  $maxTextWidth = Math::max($maxTextWidth, $textWidth);

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

                                      return Math::percent($widthInPercent, $parentWidth);

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

                                          $childrenWidth = Math::max($childrenWidth, $child->getDimensions()->getOuterWidth());

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

                                  $childrenWidth = Math::add($childrenWidth, $style->getHorizontalMarginsWidth(), $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

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

                          return Math::sub($height, $style->getVerticalBordersWidth(), $style->getVerticalPaddingsWidth());

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

                                          $childrenWidth = Math::add($childrenWidth, $child->getDimensions()->getOuterWidth());

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

                                      $childrenWidth = Math::add($childrenWidth, $child->getDimensions()->getOuterWidth());

                  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 getStyleHeight uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              return $height;
                          }

                  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 '\YetiForcePDF\Math' in method 'getMaxWidth'.
                  Open

                                  $childrenWidth = Math::add($childrenWidth, $style->getHorizontalMarginsWidth(), $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

                  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 assigning values to variables in if clauses and the like (line '179', column '10').
                  Open

                      public function getOuterWidth()
                      {
                          $box = $this->getBox();
                          if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
                              return '0';

                  IfStatementAssignment

                  Since: 2.7.0

                  Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($foo = 'bar') { // possible typo
                              // ...
                          }
                          if ($baz = 0) { // always false
                              // ...
                          }
                      }
                  }

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

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

                          return Math::add($this->getHeight(), $style->getHorizontalMarginsWidth());

                  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 getMaxWidth uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  // TODO: each block and inline-block should have source lines but for now i don't have time so this is just patch
                                  foreach ($box->getChildren() as $child) {
                                      $childrenWidth = Math::max($childrenWidth, $child->getDimensions()->getOuterWidth());
                                  }

                  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 getStyleWidth uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              return $width;
                          }

                  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 '\YetiForcePDF\Math' in method 'getMaxWidth'.
                  Open

                                  return Math::max($width, $childrenWidth);

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

                                  return Math::sub($parent->getDimensions()->computeAvailableSpace(), $parentStyle->getHorizontalBordersWidth(), $parentStyle->getHorizontalPaddingsWidth());

                  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 getMinWidth uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $minWidth = $childBox->getDimensions()->getMinWidth();
                                  $maxTextWidth = Math::max($maxTextWidth, $minWidth);
                              }

                  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 getOuterWidth uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                      } else {
                                          $childrenWidth = Math::add($childrenWidth, $child->getDimensions()->getOuterWidth());
                                      }

                  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 '\YetiForcePDF\Math' in method 'getOuterHeight'.
                  Open

                                  return Math::max($height, $childrenHeight);

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

                                      $childrenWidth = Math::max($childrenWidth, $child->getDimensions()->getOuterWidth());

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

                                  $width = Math::add($this->getWidth(), $style->getHorizontalMarginsWidth());

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

                              return Math::add($childrenWidth, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

                  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 getOuterHeight uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  foreach ($box->getChildren() as $child) {
                                      $childrenHeight = Math::max($childrenHeight, $child->getDimensions()->getOuterHeight());
                                  }
                              }

                  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 '\YetiForcePDF\Math' in method 'getOuterHeight'.
                  Open

                              return Math::add($childrenHeight, $style->getVerticalBordersWidth(), $style->getVerticalPaddingsWidth());

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

                          return Math::sub($width, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

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

                                          $childrenWidth = Math::add($childrenWidth, $childWidth);

                  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 getOuterWidth uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                      } else {
                                          $childrenWidth = Math::max($childrenWidth, $child->getDimensions()->getOuterWidth());
                                      }

                  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 getOuterWidth uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  foreach ($box->getChildren() as $child) {
                                      if ($childWidth = $child->getDimensions()->getWidth()) {
                                          $childrenWidth = Math::max($childrenWidth, $childWidth);
                                      } else {

                  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 '\YetiForcePDF\Math' in method 'getMinWidth'.
                  Open

                          return Math::add($maxTextWidth, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth(), $style->getHorizontalMarginsWidth());

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

                              return Math::add($childrenWidth, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

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

                                      $childrenHeight = Math::max($childrenHeight, $child->getDimensions()->getOuterHeight());

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

                                      $childrenWidth = Math::max($childrenWidth, $line->getChildrenWidth());

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

                                          $childrenWidth = Math::max($childrenWidth, $child->getDimensions()->getWidth() ?? '0'); // TODO: neither getOuterWidth or getWidth works here

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

                                      return Math::percent($widthInPercent, $parentHeight);

                  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

                  Rename "$box" which has the same name as the field declared at line 30.
                  Open

                          $box = $this->getBox();

                  Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

                  Noncompliant Code Example

                  class Foo {
                    public $myField;
                  
                    public function doSomething() {
                      $myField = 0;
                      ...
                    }
                  }
                  

                  See

                  Define a constant instead of duplicating this literal "display" 3 times.
                  Open

                              if ('inline' === $box->getStyle()->getRules('display')) {

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Rename "$box" which has the same name as the field declared at line 30.
                  Open

                          $box = $this->getBox();

                  Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

                  Noncompliant Code Example

                  class Foo {
                    public $myField;
                  
                    public function doSomething() {
                      $myField = 0;
                      ...
                    }
                  }
                  

                  See

                  Rename "$box" which has the same name as the field declared at line 30.
                  Open

                          $box = $this->getBox();

                  Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

                  Noncompliant Code Example

                  class Foo {
                    public $myField;
                  
                    public function doSomething() {
                      $myField = 0;
                      ...
                    }
                  }
                  

                  See

                  Rename "$box" which has the same name as the field declared at line 30.
                  Open

                          $box = $this->getBox();

                  Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

                  Noncompliant Code Example

                  class Foo {
                    public $myField;
                  
                    public function doSomething() {
                      $myField = 0;
                      ...
                    }
                  }
                  

                  See

                  Rename "$box" which has the same name as the field declared at line 30.
                  Open

                          $box = $this->getBox();

                  Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

                  Noncompliant Code Example

                  class Foo {
                    public $myField;
                  
                    public function doSomething() {
                      $myField = 0;
                      ...
                    }
                  }
                  

                  See

                  Rename "$box" which has the same name as the field declared at line 30.
                  Open

                          $box = $this->getBox();

                  Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

                  Noncompliant Code Example

                  class Foo {
                    public $myField;
                  
                    public function doSomething() {
                      $myField = 0;
                      ...
                    }
                  }
                  

                  See

                  Define a constant instead of duplicating this literal "inline" 3 times.
                  Open

                              if ('inline' === $box->getStyle()->getRules('display')) {

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  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 \YetiForcePDF\Layout\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

                          return parent::getWidth();

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

                          if (!$this->getBox()->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {

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

                              $element = $box->getElement();

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

                              $style = $this->getBox()->getStyle();

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

                          $style = $this->getBox()->getStyle();

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

                              if (null !== $this->getHeight()) {

                  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

                      {

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

                       * Get raw width.

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

                          $width = $this->getWidth();

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

                       * @return string

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

                          if (!$box instanceof LineBox) {

                  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 ($box->getChildren() as $child) {

                  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 '0';

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

                          }

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

                          if (!$this->getBox()->isDisplayable()) {

                  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

                              return '0';

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

                              // if some of the children overflows

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

                              return '0';

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

                       * Get innerHeight.

                  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

                          $box = $this->getBox();

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

                          if (!$this->getBox()->isDisplayable()) {

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

                          if (null === $height) {

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

                              $height = '0';

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

                              // if some of the children overflows

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

                       *

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

                              if ('inline' === $box->getStyle()->getRules('display')) {

                  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 getInnerWidth(): string

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

                                  }

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

                                  $childrenWidth = Math::add($childrenWidth, $style->getHorizontalMarginsWidth(), $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

                  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 getOuterHeight()

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

                                  return Math::max($height, $childrenHeight);

                  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 Math::sub($height, $style->getVerticalBordersWidth(), $style->getVerticalPaddingsWidth());

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

                              return '0';

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

                              $childrenWidth = '0';

                  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 Math::add($childrenWidth, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

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

                              } else {

                  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

                          $this->box = $box;

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

                       * Get box.

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

                          return $this->box;

                  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 '0';

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

                          return parent::getHeight();

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

                      }

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

                          if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {

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

                              if ($element && $element->getDOMElement() instanceof \DOMText) {

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

                                          $childrenWidth = Math::add($childrenWidth, $childWidth);

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

                              } else {

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

                          return $this->getBox()->getChildrenWidth();

                  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

                      public function getRawHeight()

                  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

                          $style = $box->getStyle();

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

                      public function getInnerHeight(): string

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

                      {

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

                       * Get width with margins.

                  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

                                          $childrenWidth = Math::max($childrenWidth, $childWidth);

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

                              return '0';

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

                       * Reset width.

                  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

                       * @return string|null

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

                      public function getHeight()

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

                          if (!$this->getBox()->isDisplayable()) {

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

                       * Get innerWidth.

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

                          if (null === $width) {

                  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

                       * @return string

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

                              return '0';

                  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 '0';

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

                      public function setBox(Box $box)

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

                      public function getRawWidth()

                  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

                          $height = $this->getHeight();

                  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

                      protected $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

                              if (null !== $this->getWidth()) {

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

                      public function getBox()

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

                      }

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

                       * Get height with margins.

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

                      {

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

                                      $childrenHeight = Math::add($childrenHeight, $child->getDimensions()->getOuterHeight());

                  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 resetWidth()

                  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

                              return '0';

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

                          }

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

                          if (!$this->getBox()->isDisplayable()) {

                  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

                                  $width = Math::add($this->getWidth(), $style->getHorizontalMarginsWidth());

                  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 = $this->getBox();

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

                          if (!$this->getBox()->isDisplayable()) {

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

                              $childrenHeight = '0';

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

                      }

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

                       * Get raw height.

                  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 string

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

                                  $height = $style->getLineHeight();

                  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

                                          $childrenWidth = Math::add($childrenWidth, $child->getDimensions()->getOuterWidth());

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

                                      if ($childWidth = $child->getDimensions()->getWidth()) {

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

                                      } else {

                  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 Math::max($width, $childrenWidth);

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

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

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

                                      $childrenHeight = Math::max($childrenHeight, $child->getDimensions()->getOuterHeight());

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

                                  $height = Math::add($this->getHeight(), $style->getVerticalMarginsWidth());

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

                                  return Math::max($width, $childrenWidth);

                  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

                          $box = $this->getBox();

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

                          }

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

                          $style = $box->getStyle();

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

                          if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {

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

                                      if ($childWidth = $child->getDimensions()->getWidth()) {

                  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

                              return Math::add($childrenHeight, $style->getVerticalBordersWidth(), $style->getVerticalPaddingsWidth());

                  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 $this->width;

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

                          return Math::sub($width, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

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

                              return '0';

                  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

                       * @return string

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

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

                  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

                          if (!$this->getBox()->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {

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

                              return '0';

                  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 '0';

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

                          if (!$this->getBox()->isDisplayable()) {

                  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 '0';

                  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

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

                  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 $this;

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

                       * Set 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

                      /**

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

                       * @return string|null

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

                       * @var Box

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

                      public function getWidth()

                  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 \YetiForcePDF\Layout\Box $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

                          if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {

                  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 getOuterWidth()

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

                          return $this->height;

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

                          $box = $this->getBox();

                  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 '0';

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

                                          $childrenWidth = Math::max($childrenWidth, $child->getDimensions()->getOuterWidth());

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

                                      } else {

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

                       */

                  Line exceeds 120 characters; contains 171 characters
                  Open

                                  $childrenWidth = Math::add($childrenWidth, $style->getHorizontalMarginsWidth(), $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

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

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

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

                          if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {

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

                          if (!$box instanceof LineBox) {

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

                              if ('inline' === $box->getStyle()->getRules('display')) {

                  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 Math::add($this->getHeight(), $style->getHorizontalMarginsWidth());

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

                      /**

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

                      {

                  Line exceeds 120 characters; contains 165 characters
                  Open

                                          $childrenWidth = Math::max($childrenWidth, $child->getDimensions()->getWidth() ?? '0'); // TODO: neither getOuterWidth or getWidth works here

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

                                      $childrenWidth = Math::max($childrenWidth, $child->getDimensions()->getOuterWidth());

                  Line exceeds 120 characters; contains 171 characters
                  Open

                                  $childrenWidth = Math::add($childrenWidth, $style->getHorizontalMarginsWidth(), $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

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

                       * Get minimum space that current box could have without overflow.

                  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

                       * Reset height.

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

                          $this->setHeight();

                  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 $this;

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

                              $style = $this->getBox()->getStyle();

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

                                  foreach ($box->getSourceLines() as $line) {

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

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

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

                                          $childrenWidth = Math::max($childrenWidth, $child->getDimensions()->getWidth() ?? '0'); // TODO: neither getOuterWidth or getWidth works here

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

                          }

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

                                  $textWidth = $childBox->getDimensions()->getTextWidth($childBox->getText());

                  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

                          $this->setWidth();

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

                      {

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

                          if (!$box->isForMeasurement()) {

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

                          if (!$box instanceof LineBox) {

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

                              if ('inline' === $box->getStyle()->getRules('display')) {

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

                                      if (!$child instanceof LineBox) {

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

                       * @return string

                  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 getMinWidth()

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

                                  $childrenWidth = Math::add($childrenWidth, $style->getHorizontalMarginsWidth(), $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

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

                          $maxTextWidth = '0';

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

                              return Math::add($childrenWidth, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth());

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

                          foreach ($box->getChildren() as $childBox) {

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

                          $style = $this->getBox()->getStyle();

                  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

                              return '0';

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

                      public function getTextWidth($text)

                  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

                              $child->getDimensions()->setHeight();

                  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

                              // if some of the children overflows

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

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

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

                              } else {

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

                          $box = $this->getBox();

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

                              return $box->getFirstChild()->getMinWidth();

                  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 string $text

                  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

                              $child->getDimensions()->setWidth();

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

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

                  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->getDimensions()->resetHeight();

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

                      public function getMaxWidth()

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

                          }

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

                                  $width = Math::add($this->getWidth(), $style->getHorizontalMarginsWidth());

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

                              if (null !== $this->getWidth()) {

                  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

                          if ($box instanceof TableWrapperBox) {

                  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

                              if ($childBox instanceof TextBox) {

                  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

                                  $minWidth = $childBox->getDimensions()->getMinWidth();

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

                          if (!$box->isForMeasurement()) {

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

                       * @return string

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

                      {

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

                          if (!$this->getBox()->isForMeasurement()) {

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

                              return '0';

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

                       * @return string

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

                      public function computeAvailableSpace()

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

                       * @return $this

                  Line exceeds 120 characters; contains 129 characters
                  Open

                                  // TODO: each block and inline-block should have source lines but for now i don't have time so this is just patch

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

                          if ($box instanceof TextBox) {

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

                              $child->getDimensions()->resetWidth();

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

                      public function resetHeight()

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

                       * Get max width with margins.

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

                       * @return string

                  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

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

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

                              }

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

                       * Get text width.

                  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

                              if (null !== $closestBoxDimensions->getWidth()) {

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

                              return $width;

                  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 mixed|string|null

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

                          if ('auto' === $height) {

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

                              } else {

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

                          }

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

                                  $maxTextWidth = Math::max($maxTextWidth, $minWidth);

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

                          return $font->getTextWidth($text);

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

                                  $maxTextWidth = Math::max($maxTextWidth, $textWidth);

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

                          if (!$this->getBox()->isForMeasurement()) {

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

                       */

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

                       * Compute available space (basing on parent available space and parent border and padding).

                  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

                       * @return mixed|string|null

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

                      public function getTextHeight($text)

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

                      }

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

                          $width = $this->getBox()->getStyle()->getRules('width');

                  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

                       * Calculate height from style width:10%.

                  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

                          $percentPos = strpos($height, '%');

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

                          $font = $this->box->getStyle()->getFont();

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

                          if (!$this->getBox()->isForMeasurement()) {

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

                              $parentStyle = $parent->getStyle();

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

                          if (!$this->getBox()->isForMeasurement() && !$this->getBox()) {

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

                                  $parentWidth = $closestBoxDimensions->getInnerWidth();

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

                      public function getStyleHeight()

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

                          }

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

                                      $childrenWidth = Math::add($childrenWidth, $child->getDimensions()->getOuterWidth());

                  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 Math::add($maxTextWidth, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth(), $style->getHorizontalMarginsWidth());

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

                          if (!$this->getBox()->isForMeasurement()) {

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

                          if (false !== $percentPos) {

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

                                  $parentHeight = $closestBoxDimensions->getInnerHeight();

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

                                  }

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

                                      $childrenWidth = Math::max($childrenWidth, $line->getChildrenWidth());

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

                                  // TODO: each block and inline-block should have source lines but for now i don't have time so this is just patch

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

                              return '0';

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

                       *

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

                       * Get text height.

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

                       * @param string $text

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

                              if (null === $parent->getDimensions()->getWidth()) {

                  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 getStyleWidth()

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

                      /**

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

                              $closestBoxDimensions = $this->getBox()->getClosestBox()->getDimensions();

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

                              return $height;

                  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

                          $box = $this->getBox();

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

                              $childrenWidth = '0';

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

                          return $this->getBox()->getChildrenWidth();

                  Line exceeds 120 characters; contains 152 characters
                  Open

                          return Math::add($maxTextWidth, $style->getHorizontalBordersWidth(), $style->getHorizontalPaddingsWidth(), $style->getHorizontalMarginsWidth());

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

                          return $font->getTextHeight($text);

                  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 Math::sub($parent->getDimensions()->computeAvailableSpace(), $parentStyle->getHorizontalBordersWidth(), $parentStyle->getHorizontalPaddingsWidth());

                  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

                          if (false !== $percentPos) {

                  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

                       * @return $this

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

                              } elseif (\count($box->getSourceLines())) {

                  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 $this->getTextWidth($this->getBox()->getText());

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

                          $font = $this->box->getStyle()->getFont();

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

                       * @return string

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

                              return '0';

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

                          $percentPos = strpos($width, '%');

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

                              return null;

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

                              return '0';

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

                              return null;

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

                                  if ($parentWidth) {

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

                          } else {

                  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

                              $widthInPercent = substr($height, 0, $percentPos);

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

                          }

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

                              $widthInPercent = substr($width, 0, $percentPos);

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

                          return null;

                  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 $this->getBox()->getParent()->getDimensions()->getInnerWidth();

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

                                  $style = $this->getBox()->getStyle();

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

                                  $parentWidth = Math::sub($parentWidth, $style->getHorizontalMarginsWidth());

                  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

                              if (null !== $closestBoxDimensions->getHeight()) {

                  Line exceeds 120 characters; contains 171 characters
                  Open

                                  return Math::sub($parent->getDimensions()->computeAvailableSpace(), $parentStyle->getHorizontalBordersWidth(), $parentStyle->getHorizontalPaddingsWidth());

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

                       * Calculate width from style width:10%.

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

                                      return Math::percent($widthInPercent, $parentHeight);

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

                          } else {

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

                          if ($parent = $this->getBox()->getParent()) {

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

                          if ('auto' === $width) {

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

                              $closestBoxDimensions = $this->getBox()->getClosestBox()->getDimensions();

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

                                      return Math::percent($widthInPercent, $parentWidth);

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

                          return null;

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

                          return $this->document->getCurrentPage()->getDimensions()->getWidth();

                  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 '0';

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

                          $height = $this->getBox()->getStyle()->getRules('height');

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

                                  if ($parentHeight) {

                  There are no issues that match your filters.

                  Category
                  Status