YetiForceCompany/YetiForcePDF

View on GitHub
lib/Html/Parser.php

Summary

Maintainability
C
1 day
Test Coverage

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

    public function setGroupOptions(PageGroupBox $root, \DOMDocument $domDocument)
    {
        $childDomElement = $domDocument->documentElement->firstChild;
        if (!$childDomElement instanceof \DOMElement) {
            return $this;
Severity: Minor
Found in lib/Html/Parser.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

Method parse has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function parse()
    {
        if ('' === $this->html) {
            return null;
        }
Severity: Major
Found in lib/Html/Parser.php - About 2 hrs to fix

    Function parse has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function parse()
        {
            if ('' === $this->html) {
                return null;
            }
    Severity: Minor
    Found in lib/Html/Parser.php - About 2 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

    Method setGroupOptions has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function setGroupOptions(PageGroupBox $root, \DOMDocument $domDocument)
        {
            $childDomElement = $domDocument->documentElement->firstChild;
            if (!$childDomElement instanceof \DOMElement) {
                return $this;
    Severity: Major
    Found in lib/Html/Parser.php - About 2 hrs to fix

      The method setGroupOptions() has an NPath complexity of 13122. The configured NPath complexity threshold is 200.
      Open

          public function setGroupOptions(PageGroupBox $root, \DOMDocument $domDocument)
          {
              $childDomElement = $domDocument->documentElement->firstChild;
              if (!$childDomElement instanceof \DOMElement) {
                  return $this;
      Severity: Minor
      Found in lib/Html/Parser.php by phpmd

      NPathComplexity

      Since: 0.1

      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

      Example

      class Foo {
          function bar() {
              // lots of complicated code
          }
      }

      Source https://phpmd.org/rules/codesize.html#npathcomplexity

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

          public function parse()
          {
              if ('' === $this->html) {
                  return null;
              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpmd

      CyclomaticComplexity

      Since: 0.1

      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

      Example

      // Cyclomatic Complexity = 11
      class Foo {
      1   public function example() {
      2       if ($a == $b) {
      3           if ($a1 == $b1) {
                      fiddle();
      4           } elseif ($a2 == $b2) {
                      fiddle();
                  } else {
                      fiddle();
                  }
      5       } elseif ($c == $d) {
      6           while ($c == $d) {
                      fiddle();
                  }
      7        } elseif ($e == $f) {
      8           for ($n = 0; $n < $h; $n++) {
                      fiddle();
                  }
              } else {
                  switch ($z) {
      9               case 1:
                          fiddle();
                          break;
      10              case 2:
                          fiddle();
                          break;
      11              case 3:
                          fiddle();
                          break;
                      default:
                          fiddle();
                          break;
                  }
              }
          }
      }

      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

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

          public function setGroupOptions(PageGroupBox $root, \DOMDocument $domDocument)
          {
              $childDomElement = $domDocument->documentElement->firstChild;
              if (!$childDomElement instanceof \DOMElement) {
                  return $this;
      Severity: Minor
      Found in lib/Html/Parser.php by phpmd

      CyclomaticComplexity

      Since: 0.1

      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

      Example

      // Cyclomatic Complexity = 11
      class Foo {
      1   public function example() {
      2       if ($a == $b) {
      3           if ($a1 == $b1) {
                      fiddle();
      4           } elseif ($a2 == $b2) {
                      fiddle();
                  } else {
                      fiddle();
                  }
      5       } elseif ($c == $d) {
      6           while ($c == $d) {
                      fiddle();
                  }
      7        } elseif ($e == $f) {
      8           for ($n = 0; $n < $h; $n++) {
                      fiddle();
                  }
              } else {
                  switch ($z) {
      9               case 1:
                          fiddle();
                          break;
      10              case 2:
                          fiddle();
                          break;
      11              case 3:
                          fiddle();
                          break;
                      default:
                          fiddle();
                          break;
                  }
              }
          }
      }

      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

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

          public function parse()
      Severity: Critical
      Found in lib/Html/Parser.php by sonar-php

      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 setGroupOptions(PageGroupBox $root, \DOMDocument $domDocument)
      Severity: Critical
      Found in lib/Html/Parser.php by sonar-php

      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

      Missing class import via use statement (line '209', column '23').
      Open

                  $domDocument = new \DOMDocument();
      Severity: Minor
      Found in lib/Html/Parser.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '231', column '24').
      Open

                  $rootElement = (new \YetiForcePDF\Html\Element())
      Severity: Minor
      Found in lib/Html/Parser.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      The method getHtmlPageGroups uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      $pageGroups[] = substr($html, $start);
                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

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

      Rename "$pageGroups" which has the same name as the field declared at line 43.
      Open

              $pageGroups = [];
      Severity: Major
      Found in lib/Html/Parser.php by sonar-php

      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 "$domDocument" which has the same name as the field declared at line 28.
      Open

                  $domDocument = new \DOMDocument();
      Severity: Major
      Found in lib/Html/Parser.php by sonar-php

      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

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

           * @var array page groups with html content divided
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              return preg_replace('/\n/', "\r", $html);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          public function getHtmlPageGroups(string $html)
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if (empty($pageGroups)) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @return string
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          protected function cleanUpHtml(string $html)
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @param string $html
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $this->html = htmlspecialchars_decode($html, ENT_HTML5);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $this->html = $this->cleanUpHtml($html);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @return array
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $stop = $matches[$i + 1][1];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  } else {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * Set page group options.
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              // ~0 - negated 0 - convert negation of nothing (so convert all)
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $len = $stop - $start;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @return $this
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          protected $html = '';
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * Cleanup html.
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          public function loadHtml(string $html, string $fromEncoding): self
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              return $this->html;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @param string $html
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  if (isset($matches[$i + 1])) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @param string $fromEncoding
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              // 0 - do not ommit any unicode char
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              return $pageGroups;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $html = preg_replace('/\r\n/', "\r", $html);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * Divide html into page groups.
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $pageGroups[] = substr($html, $start);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * Load html string.
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * Get html.
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $groupsCount = \count($matches);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $pageGroups[] = substr($html, $start, $len);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              for ($i = 0; $i < $groupsCount; ++$i) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @param \DOMDocument $domDocument
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          public function setGroupOptions(PageGroupBox $root, \DOMDocument $domDocument)
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @param string $html
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $this->html = mb_encode_numericentity($this->html, [0x80, 0x10FFFF, 0, ~0], $fromEncoding);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              return preg_replace('/<!--((?!-->))[\w\W]+-->/uUi', '', $html);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @var \DOMDocument
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @param string $html
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          protected $domDocument;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @var string
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              return $this;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          public function getHtml(): string
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * Remove comment blocks.
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $pageGroups = [];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $matches = [];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $matches = $matches[0];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $start = $matches[$i][1];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          protected $htmlPageGroups = [];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  return [$html];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              // 0x10FFFF - end of unicode range
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @return string
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          public function removeComments(string $html)
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @var array
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          protected $pageGroups = [];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @param string $fromEncoding
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @return Parser
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              // 0x80 - start of unicode range
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @return string
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              preg_match_all('/\<div\s+data-page-group\s?/ui', $html, $matches, PREG_OFFSET_CAPTURE);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * @param PageGroupBox $root
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  return $this;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  if (!$root->marginTop) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if ($childDomElement->hasAttribute('data-header-top')) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup = (new PageGroupBox())
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->format = $this->document->getDefaultFormat();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $this->setGroupOptions($pageGroup, $domDocument);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $page = $this->document->addPage($pageGroup->format, $pageGroup->orientation);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->setStyle($rootElement->parseStyle());
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  foreach ($this->document->getPages($groupIndex) as $page) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $root->marginRight = (float) $childDomElement->getAttribute('data-margin-right');
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if ($childDomElement->hasAttribute('data-margin-top')) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $root->marginBottom = 40;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $domDocument->encoding = 'UTF-8';
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->marginRight = $margins['right'];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $rootElement = (new \YetiForcePDF\Html\Element())
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  foreach ($this->document->getPages($groupIndex) as $page) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $page->getBox()->replacePageNumbers();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                              $page->getContentStream()->addRawContent($box->getInstructions());
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $domDocument->loadHTML('<div id="yetiforcepdf">' . $htmlPageGroup . '</div>', LIBXML_HTML_NOIMPLIED | LIBXML_NOWARNING | LIBXML_NOBLANKS | LIBXML_NOERROR);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->setElement($rootElement);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if (!$childDomElement instanceof \DOMElement) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if ($childDomElement->hasAttribute('data-format')) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $root->orientation = $childDomElement->getAttribute('data-orientation');
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          public function parse()
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $root->format = 'A4';
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  if (!$root->orientation) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $root->orientation = 'P';
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  if (!$root->marginLeft) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  if (!$root->footerBottom) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           * Convert loaded html to pdf objects.
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      ->init();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $margins = $this->document->getDefaultMargins();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->marginTop = $margins['top'];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $rootElement->init();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $page->getBox()->getStyle()->fixDomTree();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $children = [];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $root->footerBottom = (float) $childDomElement->getAttribute('data-footer-bottom');
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $domDocument->strictErrorChecking = false;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  if (!$root->marginRight) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $this->htmlPageGroups = $this->getHtmlPageGroups($this->html);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->orientation = $this->document->getDefaultOrientation();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      ->setDOMElement($domDocument->documentElement);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $page->breakOverflow();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      foreach ($children as $box) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  if (!$root->headerTop) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $domDocument->recover = false;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->marginBottom = $margins['bottom'];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $page->setUpAbsoluteBoxes();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $page->getBox()->getAllChildren($children);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $page->setMargins($pageGroup->marginLeft, $pageGroup->marginTop, $pageGroup->marginRight, $pageGroup->marginBottom);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $childDomElement = $domDocument->documentElement->firstChild;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $root->headerTop = (float) $childDomElement->getAttribute('data-header-top');
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              return $this;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if ('' === $this->html) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              foreach ($this->htmlPageGroups as $groupIndex => $htmlPageGroup) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $domDocument->substituteEntities = false;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->marginLeft = $margins['left'];
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  if (!$root->format) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if ($childDomElement->hasAttribute('data-orientation')) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $root->headerTop = 10;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $root->footerBottom = 10;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $page->setPageNumber(1);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  // root element must be defined before initialisation
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->getStyle()->fixDomTree();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  foreach ($this->document->getPages($groupIndex) as $page) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  foreach ($this->document->getPages($groupIndex) as $page) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $this->document->fixPageNumbers();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                          }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $root->marginLeft = (float) $childDomElement->getAttribute('data-margin-left');
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $root->marginBottom = (float) $childDomElement->getAttribute('data-margin-bottom');
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              $this->html = $this->removeComments($this->html);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $page->setGroup($groupIndex);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->layout();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $page->getBox()->breakPageAfter();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if ($childDomElement->hasAttribute('data-margin-right')) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $root->marginTop = 40;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  return null;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $domDocument = new \DOMDocument();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      ->setDocument($this->document)
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      ->setRoot(true)
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $this->document->setCurrentPage($page);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                          if (!$box instanceof \YetiForcePDF\Layout\LineBox && $box->isRenderable()) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $root->format = $childDomElement->getAttribute('data-format');
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if ($childDomElement->hasAttribute('data-margin-left')) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $root->marginRight = 30;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  if (!$root->marginBottom) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if ($childDomElement->hasAttribute('data-footer-bottom')) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      ->setDocument($this->document)
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->buildTree();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $page->getBox()->spanAllRows();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                      $root->marginLeft = 30;
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $root->marginTop = (float) $childDomElement->getAttribute('data-margin-top');
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

              if ($childDomElement->hasAttribute('data-margin-bottom')) {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

      Line exceeds 120 characters; contains 167 characters
      Open

                  $domDocument->loadHTML('<div id="yetiforcepdf">' . $htmlPageGroup . '</div>', LIBXML_HTML_NOIMPLIED | LIBXML_NOWARNING | LIBXML_NOBLANKS | LIBXML_NOERROR);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

      Line exceeds 120 characters; contains 128 characters
      Open

                  $page->setMargins($pageGroup->marginLeft, $pageGroup->marginTop, $pageGroup->marginRight, $pageGroup->marginBottom);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $pageGroup->fixTables();
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  $page->setBox($pageGroup);
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in lib/Html/Parser.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status