YetiForceCompany/YetiForceCRM

View on GitHub
app/Pdf/Drivers/Chromium.php

Summary

Maintainability
C
1 day
Test Coverage
F
0%

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

class Chromium extends Base
{
    /** {@inheritdoc} */
    const DRIVER_NAME = 'LBL_CHROMIUM_PDF';

Severity: Minor
Found in app/Pdf/Drivers/Chromium.php by phpmd

Chromium has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

class Chromium extends Base
{
    /** {@inheritdoc} */
    const DRIVER_NAME = 'LBL_CHROMIUM_PDF';

Severity: Minor
Found in app/Pdf/Drivers/Chromium.php - About 3 hrs to fix

    File Chromium.php has 282 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Chromium driver file for PDF generation.
     *
     * @see https://github.com/chrome-php/chrome
    Severity: Minor
    Found in app/Pdf/Drivers/Chromium.php - About 2 hrs to fix

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

          public function writeHTML()
          {
              if ($this->header) {
                  $this->pdfOptions['headerTemplate'] = $this->wrapHeaderContent($this->header);
              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.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

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

          public static function isActive(): bool
          {
              $status = false;
              if (\App\YetiForce\Register::isRegistered() && class_exists('HeadlessChromium\BrowserFactory') && \App\YetiForce\Shop::check('YetiForcePdfPremium')) {
                  try {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.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

      Class "Chromium" has 26 methods, which is greater than 20 authorized. Split it into smaller classes.
      Open

      class Chromium extends Base
      Severity: Major
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

      A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

      The class Chromium has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
      Open

      class Chromium extends Base
      {
          /** {@inheritdoc} */
          const DRIVER_NAME = 'LBL_CHROMIUM_PDF';
      
      
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      CouplingBetweenObjects

      Since: 1.1.0

      A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

      Example

      class Foo {
          /**
           * @var \foo\bar\X
           */
          private $x = null;
      
          /**
           * @var \foo\bar\Y
           */
          private $y = null;
      
          /**
           * @var \foo\bar\Z
           */
          private $z = null;
      
          public function setFoo(\Foo $foo) {}
          public function setBar(\Bar $bar) {}
          public function setBaz(\Baz $baz) {}
      
          /**
           * @return \SplObjectStorage
           * @throws \OutOfRangeException
           * @throws \InvalidArgumentException
           * @throws \ErrorException
           */
          public function process(\Iterator $it) {}
      
          // ...
      }

      Source https://phpmd.org/rules/design.html#couplingbetweenobjects

      Missing class import via use statement (line '116', column '25').
      Open

              $browserFactory = new \HeadlessChromium\BrowserFactory(\Config\Components\Pdf::$chromiumBinaryPath ?? '');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.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 '136', column '28').
      Open

                          $browserFactory = new \HeadlessChromium\BrowserFactory(\Config\Components\Pdf::$chromiumBinaryPath ?? '');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.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

      Avoid assigning values to variables in if clauses and the like (line '349', column '148').
      Open

          public function loadWatermark()
          {
              $this->watermark = '';
              if (self::WATERMARK_TYPE_IMAGE === $this->template->get('watermark_type') && '' !== trim($this->template->get('watermark_image'))) {
                  if ($this->template->get('watermark_image') && file_exists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $this->template->get('watermark_image')) && ($base64 = \App\Fields\File::getImageBaseData(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $this->template->get('watermark_image')))) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      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 '\App\Fields\File' in method 'output'.
      Open

              $tempFileName = \App\Fields\File::getTmpPath() . \App\Encryption::generatePassword(15) . '.html';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

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

              } else {
                  // Modification of the following condition will violate the license!
                  if (!\App\YetiForce\Shop::check('YetiForceDisableBranding')) {
                      $this->pdfOptions['footerTemplate'] = '<div style="position: fixed; font-size:6px; margin-left: 20px; text-align: left; z-index: 9999999;color: black !important">Powered by YetiForce</div>';
                      $this->pdfOptions['marginBottom'] = 0.4;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\YetiForce\Register' in method 'isActive'.
      Open

              if (\App\YetiForce\Register::isRegistered() && class_exists('HeadlessChromium\BrowserFactory') && \App\YetiForce\Shop::check('YetiForcePdfPremium')) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\Fields\File' in method 'loadWatermark'.
      Open

                  if ($this->template->get('watermark_image') && file_exists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $this->template->get('watermark_image')) && ($base64 = \App\Fields\File::getImageBaseData(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $this->template->get('watermark_image')))) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\Language' in method 'wrapContent'.
      Open

              return '<!DOCTYPE html><html lang="' . ($this->template->get('language') ?: \App\Language::getShortLanguageName()) . '">
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\YetiForce\Shop' in method 'isActive'.
      Open

              if (\App\YetiForce\Register::isRegistered() && class_exists('HeadlessChromium\BrowserFactory') && \App\YetiForce\Shop::check('YetiForcePdfPremium')) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\YetiForce\Shop' in method 'wrapFooterContent'.
      Open

              if (!\App\YetiForce\Shop::check('YetiForceDisableBranding')) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\Encryption' in method 'output'.
      Open

              $tempFileName = \App\Fields\File::getTmpPath() . \App\Encryption::generatePassword(15) . '.html';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\Log' in method 'isActive'.
      Open

                      \App\Log::warning($th->__toString(), __CLASS__);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\Fields\File' in method 'output'.
      Open

              $basename = \App\Fields\File::sanitizeUploadFileName($fileName);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\YetiForce\Shop' in method 'writeHTML'.
      Open

                  if (!\App\YetiForce\Shop::check('YetiForceDisableBranding')) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\Config' in method '__construct'.
      Open

              $this->setInputCharset(\App\Config::main('default_charset', 'UTF-8'));
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

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

              $this->pdfOptions['marginRight'] = self::MM_TO_IN * $margin;
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "marginBottom" 4 times.
      Open

              $this->pdfOptions['marginBottom'] = self::MM_TO_IN * $margin;
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

      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.

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

              $this->setBottomMargin($this->defaultMargins['bottom']);
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

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

              $pdf = $page->pdf($this->getPdfOptions());
      Severity: Major
      Found in app/Pdf/Drivers/Chromium.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

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

              $this->setRightMargin($this->defaultMargins['right']);
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "headerTemplate" 4 times.
      Open

                  'headerTemplate' => ' ',
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "watermark_image" 4 times.
      Open

              if (self::WATERMARK_TYPE_IMAGE === $this->template->get('watermark_type') && '' !== trim($this->template->get('watermark_image'))) {
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

      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.

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

              $this->pdfOptions['marginLeft'] = self::MM_TO_IN * $margin;
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

      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.

      Define a constant instead of duplicating this literal "footerTemplate" 4 times.
      Open

                  'footerTemplate' => ' ',
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

      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.

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

              return $this->wrapContent('<div id="header" style="color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact; ' . $style . '">' . $content . '</div>');
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by sonar-php

      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.

      Property \App\Pdf\Drivers\Chromium->pdf has undeclared type \HeadlessChromium\Browser\ProcessAwareBrowser
      Open

          protected $pdf;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method createBrowser from undeclared class \HeadlessChromium\BrowserFactory
      Open

                          $browser = $browserFactory->createBrowser(\Config\Components\Pdf::$chromiumBrowserOptions ?? []);
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method check from undeclared class \App\YetiForce\Shop
      Open

              if (\App\YetiForce\Register::isRegistered() && class_exists('HeadlessChromium\BrowserFactory') && \App\YetiForce\Shop::check('YetiForcePdfPremium')) {
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method check from undeclared class \App\YetiForce\Shop
      Open

              if (!\App\YetiForce\Shop::check('YetiForceDisableBranding')) {
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Reference to static property chromiumBinaryPath from undeclared class \Config\Components\Pdf
      Open

              $browserFactory = new \HeadlessChromium\BrowserFactory(\Config\Components\Pdf::$chromiumBinaryPath ?? '');
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Reference to static property chromiumBrowserOptions from undeclared class \Config\Components\Pdf
      Open

              $this->pdf = $browserFactory->createBrowser(\Config\Components\Pdf::$chromiumBrowserOptions ?? []);
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Reference to static property chromiumBinaryPath from undeclared class \Config\Components\Pdf
      Open

                      if (!empty(\Config\Components\Pdf::$chromiumBinaryPath)) {
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Assigning float to property but \App\Pdf\Drivers\Chromium->footerMargin is int
      Open

              $this->footerMargin = self::MM_TO_PX * $margin;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phan

      Assigning string to property but \App\Pdf\Drivers\Chromium->fontSize is int
      Open

          protected $fontSize = '16px';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method generatePassword from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
      Open

              $tempFileName = \App\Fields\File::getTmpPath() . \App\Encryption::generatePassword(15) . '.html';
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method __construct from undeclared class \HeadlessChromium\BrowserFactory
      Open

              $browserFactory = new \HeadlessChromium\BrowserFactory(\Config\Components\Pdf::$chromiumBinaryPath ?? '');
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method __construct from undeclared class \HeadlessChromium\BrowserFactory
      Open

                          $browserFactory = new \HeadlessChromium\BrowserFactory(\Config\Components\Pdf::$chromiumBinaryPath ?? '');
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Reference to constant LOAD from undeclared class \HeadlessChromium\Page (Did you mean class \App\Controller\View\Page)
      Open

              $page->navigate('file://' . $tempFileName)->waitForNavigation(\HeadlessChromium\Page::LOAD, 60000);
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Reference to static property chromiumBinaryPath from undeclared class \Config\Components\Pdf
      Open

                          $browserFactory = new \HeadlessChromium\BrowserFactory(\Config\Components\Pdf::$chromiumBinaryPath ?? '');
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method createBrowser from undeclared class \HeadlessChromium\BrowserFactory
      Open

              $this->pdf = $browserFactory->createBrowser(\Config\Components\Pdf::$chromiumBrowserOptions ?? []);
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method warning from undeclared class \App\Log
      Open

                      \App\Log::warning($th->__toString(), __CLASS__);
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method isRegistered from undeclared class \App\YetiForce\Register
      Open

              if (\App\YetiForce\Register::isRegistered() && class_exists('HeadlessChromium\BrowserFactory') && \App\YetiForce\Shop::check('YetiForcePdfPremium')) {
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Checking instanceof against undeclared class \HeadlessChromium\Browser
      Open

                          $status = $browser instanceof \HeadlessChromium\Browser;
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Reference to static property chromiumBrowserOptions from undeclared class \Config\Components\Pdf
      Open

                          $browser = $browserFactory->createBrowser(\Config\Components\Pdf::$chromiumBrowserOptions ?? []);
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Assigning float to property but \App\Pdf\Drivers\Chromium->headerMargin is int
      Open

              $this->headerMargin = self::MM_TO_PX * $margin;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method check from undeclared class \App\YetiForce\Shop
      Open

                  if (!\App\YetiForce\Shop::check('YetiForceDisableBranding')) {
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Call to method createPage from undeclared class \HeadlessChromium\Browser\ProcessAwareBrowser
      Open

              $page = $this->pdf->createPage();
      Severity: Critical
      Found in app/Pdf/Drivers/Chromium.php by phan

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          public function setMargins(array $margins)
          {
              $this->setTopMargin($margins['top'] ?? $this->defaultMargins['top']);
              $this->setBottomMargin($margins['bottom'] ?? $this->defaultMargins['bottom']);
              $this->setLeftMargin($margins['left'] ?? $this->defaultMargins['left']);
      Severity: Major
      Found in app/Pdf/Drivers/Chromium.php and 1 other location - About 3 hrs to fix
      app/Pdf/Drivers/YetiForcePDF.php on lines 100..109

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 149.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A8' => [2.05, 2.91], // = (   52 x 74   ) mm  = (  2.05 x 2.91  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A9' => [1.46, 2.05], // = (   37 x 52   ) mm  = (  1.46 x 2.05  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              '4A0' => [66.22, 93.62], // = ( 1682 x 2378 ) mm  = ( 66.22 x 93.62 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setInputCharset(\App\Config::main('default_charset', 'UTF-8'));
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $status = false;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A4' => [8.27, 11.69], // = (  210 x 297  ) mm  = (  8.27 x 11.69 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B1' => [27.83, 39.37], // = (  707 x 1000 ) mm  = ( 27.83 x 39.37 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C3' => [12.76, 18.03], // = (  324 x 458  ) mm  = ( 12.76 x 18.03 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'SRA0' => [35.43, 50.39], // = (  900 x 1280 ) mm  = ( 35.43 x 50.39 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'EXECUTIVE' => [7.25, 10.50], // = (  184 x 267  ) mm  = (  7.25 x 10.50 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param float $margin
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          const MM_TO_IN = 0.0393701;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          const MM_TO_PX = 3.7795275591;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // ISO 216 B Series + 2 SIS 014711 extensions
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      \App\Log::warning($th->__toString(), __CLASS__);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->pdfOptions['marginTop'] = self::MM_TO_IN * $margin;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->pdfOptions['marginBottom'] = self::MM_TO_IN * $margin;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B2' => [19.69, 27.83], // = (  500 x 707  ) mm  = ( 19.69 x 27.83 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B6' => [4.92, 6.93], // = (  125 x 176  ) mm  = (  4.92 x 6.93  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'SRA2' => [17.72, 25.20], // = (  450 x 640  ) mm  = ( 17.72 x 25.20 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'printBackground' => true,
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'footerTemplate' => ' ',
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** @var float Millimeter to pixel converter */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A2' => [16.54, 23.39], // = (  420 x 594  ) mm  = ( 16.54 x 23.39 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B9' => [1.73, 2.44], // = (   44 x 62   ) mm  = (  1.73 x 2.44  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // ISO 216 C Series + 2 SIS 014711 extensions + 5 EXTENSION
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C5' => [6.38, 9.02], // = (  162 x 229  ) mm  = (  6.38 x 9.02  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C8' => [2.24, 3.19], // = (   57 x 81   ) mm  = (  2.24 x 3.19  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'RA1' => [24.02, 33.86], // = (  610 x 860  ) mm  = ( 24.02 x 33.86 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Constructor.
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

       * @author      Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A0' => [33.11, 46.81], // = (  841 x 1189 ) mm  = ( 33.11 x 46.81 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C6' => [4.49, 6.38], // = (  114 x 162  ) mm  = (  4.49 x 6.38  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C9' => [1.57, 2.24], // = (   40 x 57   ) mm  = (  1.57 x 2.24  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C10' => [1.10, 1.57], // = (   28 x 40   ) mm  = (  1.10 x 1.57  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'RA0' => [33.86, 48.03], // = (  860 x 1220 ) mm  = ( 33.86 x 48.03 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              '2A0' => [46.81, 66.22], // = ( 1189 x 1682 ) mm  = ( 46.81 x 66.22 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A' => [4.37, 7.00], // = (  111 x 178  ) mm  = (  4.37 x 7.00 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->pdf = $browserFactory->createBrowser(\Config\Components\Pdf::$chromiumBrowserOptions ?? []);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->pdfOptions = [
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $browser = $browserFactory->createBrowser(\Config\Components\Pdf::$chromiumBrowserOptions ?? []);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setAuthor(string $author)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function wrapFooterContent(string $content): string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if ($this->pdfOptions['marginBottom'] < (float) 0.4) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C7' => [3.19, 4.49], // = (   81 x 114  ) mm  = (  3.19 x 4.49  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // ISO Press
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'DEMY' => [8.50, 5.31], // = (  135 x 216  ) mm  = (  8.50 x 5.31 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          protected $pdfHtml;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setLeftMargin($this->defaultMargins['left']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $status = $browser instanceof \HeadlessChromium\Browser;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->pdfOptions['marginLeft'] = self::MM_TO_IN * $margin;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setRightMargin(float $margin)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->footer = trim($footerHtml);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this->wrapContent('<div id="header" style="color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact; ' . $style . '">' . $content . '</div>');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param string $content
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $content .= '</div>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A1' => [23.39, 33.11], // = (  594 x 841  ) mm  = ( 23.39 x 33.11 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A3' => [11.69, 16.54], // = (  297 x 420  ) mm  = ( 11.69 x 16.54 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B3' => [13.90, 19.69], // = (  353 x 500  ) mm  = ( 13.90 x 19.69 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B7' => [3.46, 4.92], // = (   88 x 125  ) mm  = (  3.46 x 4.92  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C4' => [9.02, 12.76], // = (  229 x 324  ) mm  = (  9.02 x 12.76 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          protected $font = '"Times New Roman", Times, serif';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** @var \HeadlessChromium\Browser\ProcessAwareBrowser PDF generator instance. */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  } catch (\Throwable $th) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setBottomMargin(float $margin)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setTopMargin($margins['top'] ?? $this->defaultMargins['top']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // does not support this feature
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          const PAGE_FORMATS = [
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'SRA1' => [25.20, 35.43], // = (  640 x 900  ) mm  = ( 25.20 x 35.43 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'SRA4' => [8.86, 12.60], // = (  225 x 320  ) mm  = (  8.86 x 12.60 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B' => [5.04, 7.80],  // = (  128 x 198  ) mm  = (  5.04 x 7.80 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public static function isActive(): bool
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->pdfOptions['marginRight'] = self::MM_TO_IN * $margin;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // does not support this feature
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($this->header) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  // Modification of the following condition will violate the license!
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param string $content
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'RA4' => [8.46, 12.01], // = (  215 x 305  ) mm  = (  8.46 x 12.01 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** @var string Default font. */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function __construct()
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $browserFactory = new \HeadlessChromium\BrowserFactory(\Config\Components\Pdf::$chromiumBinaryPath ?? '');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      if (!empty(\Config\Components\Pdf::$chromiumBinaryPath)) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setHeaderMargin(float $margin)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->footerMargin = self::MM_TO_PX * $margin;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setMargins(array $margins)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->pdfOptions['paperWidth'] = self::PAGE_FORMATS[$format][0];
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function wrapHeaderContent(string $content): string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return str_replace(['{p}', '{a}'], ['<span class="pageNumber"></span>', '<span class="totalPages"></span>'], $content);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          const DRIVER_NAME = 'LBL_CHROMIUM_PDF';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B10' => [1.22, 1.73], // = (   31 x 44   ) mm  = (  1.22 x 1.73  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C1' => [25.51, 36.10], // = (  648 x 917  ) mm  = ( 25.51 x 36.10 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // German DIN 476
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'LETTER' => [8.50, 11.00], // = (  216 x 279  ) mm  = (  8.50 x 11.00 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'LEDGER' => [17.00, 11.00], // = (  432 x 279  ) mm  = ( 17.00 x 11.00 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** @var string Pdf HTML content. */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'headerTemplate' => ' ',
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setTopMargin($this->defaultMargins['top']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setLeftMargin(float $margin)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($orientation) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Write html.
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (!\App\YetiForce\Shop::check('YetiForceDisableBranding')) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $content .= '<div style="position: fixed; font-size:6px; margin-left: 20px; text-align: left; z-index: 9999999;color: black !important">Powered by YetiForce</div>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'RA2' => [16.93, 24.02], // = (  430 x 610  ) mm  = ( 16.93 x 24.02 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          protected $fontSize = '16px';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (\App\YetiForce\Register::isRegistered() && class_exists('HeadlessChromium\BrowserFactory') && \App\YetiForce\Shop::check('YetiForcePdfPremium')) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if (!\App\YetiForce\Shop::check('YetiForceDisableBranding')) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $this->pdfOptions['marginBottom'] = 0.4;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (!empty($this->pdfOptions['headerTemplate']) || !empty($this->pdfOptions['footerTemplate'])) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $watermark = $this->watermark ? $this->wrapWatermark($this->template->parseVariables($this->watermark)) : '';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (empty(trim($this->pdfOptions['headerTemplate']))) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A10' => [1.02, 1.46], // = (   26 x 37   ) mm  = (  1.02 x 1.46  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              ];
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  try {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $status;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setKeywords(array $keywords)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setFooter(string $footerHtml)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return $this
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function wrapWatermark(string $watermarkContent): string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if ($this->template->get('watermark_image') && file_exists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $this->template->get('watermark_image')) && ($base64 = \App\Fields\File::getImageBaseData(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $this->template->get('watermark_image')))) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              echo base64_decode($pdf->getBase64(60000));
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return '<!DOCTYPE html><html lang="' . ($this->template->get('language') ?: \App\Language::getShortLanguageName()) . '">
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** @var float Millimeter to inch converter */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // ISO 216 A Series + 2 SIS 014711 extensions
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A6' => [4.13, 5.83], // = (  105 x 148  ) mm  = (  4.13 x 5.83  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A7' => [2.91, 4.13], // = (   74 x 105  ) mm  = (  2.91 x 4.13  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B5' => [6.93, 9.84], // = (  176 x 250  ) mm  = (  6.93 x 9.84  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C2' => [18.03, 25.51], // = (  458 x 648  ) mm  = ( 18.03 x 25.51 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // Traditional 'Loose' North American Paper Sizes
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'FOLIO' => [8.50, 13.00], // = (  216 x 330  ) mm  = (  8.50 x 13.00 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          ];
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** @var int Default font size (px). */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setLeftMargin($margins['left'] ?? $this->defaultMargins['left']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->pdfOptions['paperHeight'] = self::PAGE_FORMATS[$format][1];
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->header = trim($headerHtml);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($this->footer) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $this->pdfOptions['displayHeaderFooter'] = true;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->watermark = '';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              header("content-disposition: {$destination}; filename=\"{$basename}\"");
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setPageSize(string $format, string $orientation = null)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // does not support this feature
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Wrap header content.
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $content = '<div id="footer" style="color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact; ' . $style . '">' . $content;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Wrap watermark.
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $fileName = ($this->getFileName() ?: time()) . '.pdf';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $page = $this->pdf->createPage();
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'A5' => [5.83, 8.27], // = (  148 x 210  ) mm  = (  5.83 x 8.27  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'RA3' => [12.01, 16.93], // = (  305 x 430  ) mm  = ( 12.01 x 16.93 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'LEGAL' => [8.50, 14.00], // = (  216 x 356  ) mm  = (  8.50 x 14.00 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** @var array Pdf options. */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setBottomMargin($this->defaultMargins['bottom']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setRightMargin($this->defaultMargins['right']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setFooterMargin($margins['footer'] ?? $this->defaultMargins['footer']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $this->pdfOptions['landscape'] = 'L' === $orientation;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              } else {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->writeHTML();
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $tempFileName = \App\Fields\File::getTmpPath() . \App\Encryption::generatePassword(15) . '.html';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B0' => [39.37, 55.67], // = ( 1000 x 1414 ) mm  = ( 39.37 x 55.67 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B4' => [9.84, 13.90], // = (  250 x 353  ) mm  = (  9.84 x 13.90 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'B8' => [2.44, 3.46], // = (   62 x 88   ) mm  = (  2.44 x 3.46  ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'C0' => [36.10, 51.06], // = (  917 x 1297 ) mm  = ( 36.10 x 51.06 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'SRA3' => [12.60, 17.72], // = (  320 x 450  ) mm  = ( 12.60 x 17.72 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'TABLOID' => [11.00, 17.00], // = (  279 x 432  ) mm  = ( 11.00 x 17.00 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              'ROYAL' => [6.02, 9.21], // = (  153 x 234  ) mm  = (  6.02 x 9.21 ) in
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          protected $pdf;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          protected $pdfOptions = [];
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $browserFactory = new \HeadlessChromium\BrowserFactory(\Config\Components\Pdf::$chromiumBinaryPath ?? '');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setTopMargin(float $margin)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Set left margin.
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->headerMargin = self::MM_TO_PX * $margin;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setTitle(string $title)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setSubject(string $subject)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // does not support this feature
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $this->pdfOptions['headerTemplate'] = $this->wrapHeaderContent($this->header);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $this->pdfOptions['footerTemplate'] = $this->wrapFooterContent($this->footer);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // Modification of the following condition will violate the license!
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // Modification of the following condition will violate the license!
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (self::WATERMARK_TYPE_IMAGE === $this->template->get('watermark_type') && '' !== trim($this->template->get('watermark_image'))) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $this->watermark = '<div id="watermark-text" style="position: relative; top: 50%; transform: rotate(-' . $this->template->get('watermark_angle') . 'deg);">' . $this->template->get('watermark_text') . '</div>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setBottomMargin($margins['bottom'] ?? $this->defaultMargins['bottom']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setHeader(string $headerHtml)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $style = "padding-bottom: {$this->footerMargin}px; padding-left: {$this->pdfOptions['marginLeft']}mm; padding-right: {$this->pdfOptions['marginRight']}mm;";
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              file_put_contents($tempFileName, $this->getPdfHtml());
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $pdf->saveToFile($fileName);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Get PDF HTML.
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          protected function getPdfHtml(): string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this->pdfHtml;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($this->template->get('styles')) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setCreator(string $creator)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function writeHTML()
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->pdfHtml = $this->wrapContent('<div id="body">' . $watermark . '<div id="content">' . $this->getBody() . '</div></div>');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function loadWatermark()
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          protected function getPdfOptions(): array
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function setFooterMargin(float $margin)
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setRightMargin($margins['right'] ?? $this->defaultMargins['right']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->setHeaderMargin($margins['header'] ?? $this->defaultMargins['header']);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $this->pdfOptions['footerTemplate'] = '<div style="position: fixed; font-size:6px; margin-left: 20px; text-align: left; z-index: 9999999;color: black !important">Powered by YetiForce</div>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Wrap footer content.
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $this->pdfOptions['marginBottom'] = 0.4;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return '<div id="watermark" style="position: fixed; z-index: -1; text-align:center; vertical-align: middle; width: 100%; height: 100%;">' . $watermarkContent . '</div>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              header('content-type: application/pdf; charset=utf-8');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $style .= PHP_EOL . str_replace(['<', '>'], '', $this->template->get('styles'));
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $content = str_replace(['{p}', '{a}'], ['<span class="pageNumber"></span>', '<span class="totalPages"></span>'], $content);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function output($fileName = '', $mode = 'D'): void
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $page->navigate('file://' . $tempFileName)->waitForNavigation(\HeadlessChromium\Page::LOAD, 60000);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Get PDF options.
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return array
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this->pdfOptions;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $this->watermark = '<img id="watermark-image" src="' . $base64 . '" style="max-width: 100%; max-height: 100%;"/>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              // does not support this feature
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  // Modification of the following condition will violate the license!
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $style = ";padding-top: {$this->headerMargin}px; padding-left: {$this->pdfOptions['marginLeft']}mm; padding-right: {$this->pdfOptions['marginRight']}mm;";
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  return $this->wrapContent($content);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Wrap body content.
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ('I' !== $mode && 'D' !== $mode) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (empty($fileName)) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $destination = 'I' === $mode ? 'inline' : 'attachment';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              } elseif (self::WATERMARK_TYPE_TEXT === $this->template->get('watermark_type') && '' !== trim($this->template->get('watermark_text'))) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          protected function wrapContent(string $content): string
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param string $watermarkContent
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              unlink($tempFileName);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param string $content
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $pdf = $page->pdf($this->getPdfOptions());
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  return;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              header('accept-charset: utf-8');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $basename = \App\Fields\File::sanitizeUploadFileName($fileName);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $style = 'body{' . ($this->font ? ('font-family: ' . $this->font . ';') : '') . ($this->fontSize ? ('font-size: ' . $this->fontSize . ';') : '') . ';}';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 158 characters
      Open

              if (\App\YetiForce\Register::isRegistered() && class_exists('HeadlessChromium\BrowserFactory') && \App\YetiForce\Shop::check('YetiForcePdfPremium')) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 127 characters
      Open

              return str_replace(['{p}', '{a}'], ['<span class="pageNumber"></span>', '<span class="totalPages"></span>'], $content);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 135 characters
      Open

              $this->pdfHtml = $this->wrapContent('<div id="body">' . $watermark . '<div id="content">' . $this->getBody() . '</div></div>');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 162 characters
      Open

              $style = ";padding-top: {$this->headerMargin}px; padding-left: {$this->pdfOptions['marginLeft']}mm; padding-right: {$this->pdfOptions['marginRight']}mm;";
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 183 characters
      Open

              return $this->wrapContent('<div id="header" style="color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact; ' . $style . '">' . $content . '</div>');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 176 characters
      Open

                  $content .= '<div style="position: fixed; font-size:6px; margin-left: 20px; text-align: left; z-index: 9999999;color: black !important">Powered by YetiForce</div>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 164 characters
      Open

              $style = "padding-bottom: {$this->footerMargin}px; padding-left: {$this->pdfOptions['marginLeft']}mm; padding-right: {$this->pdfOptions['marginRight']}mm;";
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 177 characters
      Open

              return '<div id="watermark" style="position: fixed; z-index: -1; text-align:center; vertical-align: middle; width: 100%; height: 100%;">' . $watermarkContent . '</div>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 206 characters
      Open

                      $this->pdfOptions['footerTemplate'] = '<div style="position: fixed; font-size:6px; margin-left: 20px; text-align: left; z-index: 9999999;color: black !important">Powered by YetiForce</div>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 128 characters
      Open

              return '<!DOCTYPE html><html lang="' . ($this->template->get('language') ?: \App\Language::getShortLanguageName()) . '">
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 126 characters
      Open

                          $browserFactory = new \HeadlessChromium\BrowserFactory(\Config\Components\Pdf::$chromiumBinaryPath ?? '');
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 156 characters
      Open

              $content = '<div id="footer" style="color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact; ' . $style . '">' . $content;
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 131 characters
      Open

              $content = str_replace(['{p}', '{a}'], ['<span class="pageNumber"></span>', '<span class="totalPages"></span>'], $content);
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 130 characters
      Open

                      $this->watermark = '<img id="watermark-image" src="' . $base64 . '" style="max-width: 100%; max-height: 100%;"/>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 144 characters
      Open

              } elseif (self::WATERMARK_TYPE_TEXT === $this->template->get('watermark_type') && '' !== trim($this->template->get('watermark_text'))) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 221 characters
      Open

                  $this->watermark = '<div id="watermark-text" style="position: relative; top: 50%; transform: rotate(-' . $this->template->get('watermark_angle') . 'deg);">' . $this->template->get('watermark_text') . '</div>';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 140 characters
      Open

              if (self::WATERMARK_TYPE_IMAGE === $this->template->get('watermark_type') && '' !== trim($this->template->get('watermark_image'))) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 285 characters
      Open

                  if ($this->template->get('watermark_image') && file_exists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $this->template->get('watermark_image')) && ($base64 = \App\Fields\File::getImageBaseData(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $this->template->get('watermark_image')))) {
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      Line exceeds 120 characters; contains 160 characters
      Open

              $style = 'body{' . ($this->font ? ('font-family: ' . $this->font . ';') : '') . ($this->fontSize ? ('font-size: ' . $this->fontSize . ';') : '') . ';}';
      Severity: Minor
      Found in app/Pdf/Drivers/Chromium.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status