YetiForceCompany/YetiForceCRM

View on GitHub
app/Mailer.php

Summary

Maintainability
F
4 days
Test Coverage
F
14%

The method Mailer::send() calls the typical debug function print_r() which is mostly only used during development.
Open

        $toAddresses = $this->mailer->From . ' >> ' . \print_r($this->mailer->getToAddresses(), true);
Severity: Minor
Found in app/Mailer.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

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

The method Mailer::send() calls the typical debug function print_r() which is mostly only used during development.
Open

        Log::error('Mailer Error: ' . \print_r($this->mailer->ErrorInfo, true), 'Mailer');
Severity: Minor
Found in app/Mailer.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

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

File Mailer.php has 472 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace App;

/**
Severity: Minor
Found in app/Mailer.php - About 7 hrs to fix

    Function sendByRowQueue has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function sendByRowQueue($rowQueue)
        {
            if ('demo' === \App\Config::main('systemMode')) {
                return true;
            }
    Severity: Minor
    Found in app/Mailer.php - About 7 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        public function setSmtp(): void
        {
            if (!$this->smtp) {
                throw new \App\Exceptions\AppException('ERR_NO_SMTP_CONFIGURATION');
            }
    Severity: Minor
    Found in app/Mailer.php - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    The class Mailer has 19 public methods. Consider refactoring Mailer to keep number of public methods under 10.
    Open

    class Mailer
    {
        /** @var string[] Queue status */
        public static $statuses = [
            0 => 'LBL_PENDING_ACCEPTANCE',
    Severity: Minor
    Found in app/Mailer.php by phpmd

    TooManyPublicMethods

    Since: 0.1

    A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

    By default it ignores methods starting with 'get' or 'set'.

    Example

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

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

    class Mailer
    {
        /** @var string[] Queue status */
        public static $statuses = [
            0 => 'LBL_PENDING_ACCEPTANCE',
    Severity: Minor
    Found in app/Mailer.php by phpmd

    Method sendByRowQueue has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function sendByRowQueue($rowQueue)
        {
            if ('demo' === \App\Config::main('systemMode')) {
                return true;
            }
    Severity: Major
    Found in app/Mailer.php - About 3 hrs to fix

      Method setSmtp has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function setSmtp(): void
          {
              if (!$this->smtp) {
                  throw new \App\Exceptions\AppException('ERR_NO_SMTP_CONFIGURATION');
              }
      Severity: Major
      Found in app/Mailer.php - About 3 hrs to fix

        Mailer has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Mailer
        {
            /** @var string[] Queue status */
            public static $statuses = [
                0 => 'LBL_PENDING_ACCEPTANCE',
        Severity: Minor
        Found in app/Mailer.php - About 2 hrs to fix

          Method sendFromTemplate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function sendFromTemplate(array $params): bool
              {
                  Log::trace('Send mail from template', 'Mailer');
                  if (empty($params['template'])) {
                      Log::warning('No template', 'Mailer');
          Severity: Minor
          Found in app/Mailer.php - About 1 hr to fix

            Function sendFromTemplate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function sendFromTemplate(array $params): bool
                {
                    Log::trace('Send mail from template', 'Mailer');
                    if (empty($params['template'])) {
                        Log::warning('No template', 'Mailer');
            Severity: Minor
            Found in app/Mailer.php - About 1 hr to fix

            Cognitive Complexity

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

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

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

            Further reading

            Method addMail has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function addMail(array $params): bool
                {
                    $params['status'] = Config::component('Mail', 'MAILER_REQUIRED_ACCEPTATION_BEFORE_SENDING') ? 0 : 1;
                    $params['date'] = date('Y-m-d H:i:s');
                    if (empty($params['owner'])) {
            Severity: Minor
            Found in app/Mailer.php - About 1 hr to fix

              Method send has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function send(): bool
                  {
                      $eventHandler = new EventHandler();
                      $eventHandler->setParams(['mailer' => $this]);
                      $eventHandler->trigger('MailerBeforeSend');
              Severity: Minor
              Found in app/Mailer.php - About 1 hr to fix

                Function send has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function send(): bool
                    {
                        $eventHandler = new EventHandler();
                        $eventHandler->setParams(['mailer' => $this]);
                        $eventHandler->trigger('MailerBeforeSend');
                Severity: Minor
                Found in app/Mailer.php - About 45 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 insertMail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function insertMail(array $params, string $type): void
                    {
                        $eventHandler = new EventHandler();
                        $eventHandler->setParams($params);
                        $eventHandler->trigger('admin' === $type ? 'MailerAddToQueue' : 'MailerAddToLogs');
                Severity: Minor
                Found in app/Mailer.php - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                The method setSmtp() has an NPath complexity of 49920. The configured NPath complexity threshold is 200.
                Open

                    public function setSmtp(): void
                    {
                        if (!$this->smtp) {
                            throw new \App\Exceptions\AppException('ERR_NO_SMTP_CONFIGURATION');
                        }
                Severity: Minor
                Found in app/Mailer.php by phpmd

                NPathComplexity

                Since: 0.1

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

                Example

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

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

                The method sendFromTemplate() has an NPath complexity of 1728. The configured NPath complexity threshold is 200.
                Open

                    public static function sendFromTemplate(array $params): bool
                    {
                        Log::trace('Send mail from template', 'Mailer');
                        if (empty($params['template'])) {
                            Log::warning('No template', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpmd

                NPathComplexity

                Since: 0.1

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

                Example

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

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

                The method sendByRowQueue() has an NPath complexity of 15840. The configured NPath complexity threshold is 200.
                Open

                    public static function sendByRowQueue($rowQueue)
                    {
                        if ('demo' === \App\Config::main('systemMode')) {
                            return true;
                        }
                Severity: Minor
                Found in app/Mailer.php by phpmd

                NPathComplexity

                Since: 0.1

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

                Example

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

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

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

                    public function setSmtp(): void
                    {
                        if (!$this->smtp) {
                            throw new \App\Exceptions\AppException('ERR_NO_SMTP_CONFIGURATION');
                        }
                Severity: Minor
                Found in app/Mailer.php by phpmd

                CyclomaticComplexity

                Since: 0.1

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

                Example

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

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

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

                    public static function sendByRowQueue($rowQueue)
                    {
                        if ('demo' === \App\Config::main('systemMode')) {
                            return true;
                        }
                Severity: Minor
                Found in app/Mailer.php by phpmd

                CyclomaticComplexity

                Since: 0.1

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

                Example

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

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

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

                    public static function sendFromTemplate(array $params): bool
                    {
                        Log::trace('Send mail from template', 'Mailer');
                        if (empty($params['template'])) {
                            Log::warning('No template', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpmd

                CyclomaticComplexity

                Since: 0.1

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

                Example

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

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

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

                    public static function sendByRowQueue($rowQueue)
                Severity: Critical
                Found in app/Mailer.php by sonar-php

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

                See

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

                    public static function addMail(array $params): bool
                Severity: Major
                Found in app/Mailer.php by sonar-php

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

                Noncompliant Code Example

                With the default threshold of 3:

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

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

                    public function setSmtp(): void
                Severity: Critical
                Found in app/Mailer.php by sonar-php

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

                See

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

                class Mailer
                Severity: Major
                Found in app/Mailer.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 Mailer has a coupling between objects value of 19. Consider to reduce the number of dependencies under 13.
                Open

                class Mailer
                {
                    /** @var string[] Queue status */
                    public static $statuses = [
                        0 => 'LBL_PENDING_ACCEPTANCE',
                Severity: Minor
                Found in app/Mailer.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 '48', column '23').
                Open

                        $this->mailer = new \PHPMailer\PHPMailer\PHPMailer(false);
                Severity: Minor
                Found in app/Mailer.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 '236', column '14').
                Open

                            throw new \App\Exceptions\AppException('ERR_NO_SMTP_CONFIGURATION');
                Severity: Minor
                Found in app/Mailer.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 using static access to class '\App\Mail' in method 'addMail'.
                Open

                        if (!\App\Mail::getSmtpById($params['smtp_id'])) {
                Severity: Minor
                Found in app/Mailer.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 'send'.
                Open

                            \App\Log::endProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Minor
                Found in app/Mailer.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\Mail' in method 'addMail'.
                Open

                            $params['smtp_id'] = Mail::getDefaultSmtp();
                Severity: Minor
                Found in app/Mailer.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 '__construct'.
                Open

                                    Log::error(trim($str), 'Mailer');
                Severity: Minor
                Found in app/Mailer.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\User' in method 'addMail'.
                Open

                            $owner = User::getCurrentUserRealId();
                Severity: Minor
                Found in app/Mailer.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 'addMail'.
                Open

                            Log::warning('No target email address provided', 'Mailer');
                Severity: Minor
                Found in app/Mailer.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\Mail' in method 'loadSmtpByID'.
                Open

                        $this->smtp = Mail::getSmtpById($smtpId);
                Severity: Minor
                Found in app/Mailer.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\TextParser' in method 'sendFromTemplate'.
                Open

                        $textParser = $recordModel ? TextParser::getInstanceByModel($recordModel) : TextParser::getInstance($params['moduleName'] ?? '');
                Severity: Minor
                Found in app/Mailer.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 'addMail'.
                Open

                            Log::warning('No SMTP configuration', 'Mailer');
                Severity: Minor
                Found in app/Mailer.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 'test'.
                Open

                                Log::error(trim($str), 'Mailer');
                Severity: Minor
                Found in app/Mailer.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 'test'.
                Open

                                Log::trace(trim($str), 'Mailer');
                Severity: Minor
                Found in app/Mailer.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\Mail' in method 'test'.
                Open

                        $templateId = Mail::getTemplateIdFromSysName('TestMailAboutTheMailServerConfiguration');
                Severity: Minor
                Found in app/Mailer.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 'sendFromTemplate'.
                Open

                            Log::warning('No template', 'Mailer');
                Severity: Minor
                Found in app/Mailer.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 'sendFromTemplate'.
                Open

                            Log::warning('No mail template', 'Mailer');
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'setSmtp'.
                Open

                            foreach (\App\Json::decode($this->smtp['unsubscribe']) as $row) {
                Severity: Minor
                Found in app/Mailer.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 'content'.
                Open

                        if (!\App\YetiForce\Shop::check('YetiForceDisableBranding')) {
                Severity: Minor
                Found in app/Mailer.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 'send'.
                Open

                        \App\Log::beginProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Minor
                Found in app/Mailer.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 '__construct'.
                Open

                                    Log::trace(trim($str), 'Mailer');
                Severity: Minor
                Found in app/Mailer.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 'addMail'.
                Open

                            Log::warning('SMTP configuration with provided id not exists', 'Mailer');
                Severity: Minor
                Found in app/Mailer.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 test uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                            } else {
                                Log::trace(trim($str), 'Mailer');
                            }
                Severity: Minor
                Found in app/Mailer.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\TextParser' in method 'test'.
                Open

                        $textParser = TextParser::getInstanceById($currentUser->getId(), 'Users');
                Severity: Minor
                Found in app/Mailer.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\Purifier' in method 'sendFromTemplate'.
                Open

                        $params['content'] = $textParser->setContent(\App\Utils\Completions::decode(\App\Purifier::purifyHtml($template['content'])))->parse()->getContent();
                Severity: Minor
                Found in app/Mailer.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->mailer->CharSet = \App\Config::main('default_charset');
                Severity: Minor
                Found in app/Mailer.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 'send'.
                Open

                        Log::error('Mailer Error: ' . \print_r($this->mailer->ErrorInfo, true), 'Mailer');
                Severity: Minor
                Found in app/Mailer.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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                } else {
                                    Log::trace(trim($str), 'Mailer');
                                }
                Severity: Minor
                Found in app/Mailer.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\Log' in method 'sendFromTemplate'.
                Open

                        Log::trace('Send mail from template', 'Mailer');
                Severity: Minor
                Found in app/Mailer.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 'send'.
                Open

                            Log::trace('Mailer sent mail', 'Mailer');
                Severity: Minor
                Found in app/Mailer.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 'test'.
                Open

                            return ['result' => false, 'error' => Language::translate('LBL_NO_EMAIL_TEMPLATE')];
                Severity: Minor
                Found in app/Mailer.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

                        if (\App\Config::debug('MAILER_DEBUG')) {
                Severity: Minor
                Found in app/Mailer.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\TextParser' in method 'sendFromTemplate'.
                Open

                        $textParser = $recordModel ? TextParser::getInstanceByModel($recordModel) : TextParser::getInstance($params['moduleName'] ?? '');
                Severity: Minor
                Found in app/Mailer.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\Utils\Completions' in method 'sendFromTemplate'.
                Open

                        $params['content'] = $textParser->setContent(\App\Utils\Completions::decode(\App\Purifier::purifyHtml($template['content'])))->parse()->getContent();
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'setSmtp'.
                Open

                            $this->mailer->SMTPOptions = Json::decode($this->smtp['options'], true);
                Severity: Minor
                Found in app/Mailer.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\Mail' in method 'test'.
                Open

                        $template = Mail::getTemplate($templateId);
                Severity: Minor
                Found in app/Mailer.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\Mail' in method 'sendFromTemplate'.
                Open

                        $template = Mail::getTemplate($params['template']);
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'insertMail'.
                Open

                                $params[$key] = Json::encode($params[$key]);
                Severity: Minor
                Found in app/Mailer.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 'send'.
                Open

                        \App\Log::endProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Minor
                Found in app/Mailer.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 send uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            static::$error[] = $this->mailer->ErrorInfo;
                        }
                Severity: Minor
                Found in app/Mailer.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 '\Users_Record_Model' in method 'test'.
                Open

                        $currentUser = \Users_Record_Model::getCurrentUserModel();
                Severity: Minor
                Found in app/Mailer.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 '\Vtiger_Record_Model' in method 'sendFromTemplate'.
                Open

                                $recordModel = \Vtiger_Record_Model::getInstanceById($params['recordId'], $moduleName);
                Severity: Minor
                Found in app/Mailer.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 sendFromTemplate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            $recordModel = $params['recordModel'];
                            unset($params['recordModel']);
                        }
                Severity: Minor
                Found in app/Mailer.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\Config' in method 'addMail'.
                Open

                        $params['status'] = Config::component('Mail', 'MAILER_REQUIRED_ACCEPTATION_BEFORE_SENDING') ? 0 : 1;
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'sendByRowQueue'.
                Open

                            $attachments = Json::decode($rowQueue['attachments']);
                Severity: Minor
                Found in app/Mailer.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 '\OSSMail_Record_Model' in method 'saveMail'.
                Open

                        $mbox = \OSSMail_Record_Model::imapConnect(
                            $this->smtp['smtp_username'],
                            Encryption::getInstance()->decrypt($this->smtp['smtp_password']),
                            $this->smtp['smtp_host'] . ':' . $this->smtp['smtp_port'], $folder, false,
                            [
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'sendByRowQueue'.
                Open

                                foreach (Json::decode($rowQueue[$key]) as $email => $name) {
                Severity: Minor
                Found in app/Mailer.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 'saveMail'.
                Open

                            Log::error('Mailer Error: No smtp data entered', 'Mailer');
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'sendByRowQueue'.
                Open

                            $from = Json::decode($rowQueue['from']);
                Severity: Minor
                Found in app/Mailer.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 'saveMail'.
                Open

                        \App\Log::beginProfile(__METHOD__ . '|imap_append', 'Mail|IMAP');
                Severity: Minor
                Found in app/Mailer.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 'sendByRowQueue'.
                Open

                        if ('demo' === \App\Config::main('systemMode')) {
                Severity: Minor
                Found in app/Mailer.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 'saveMail'.
                Open

                        \App\Log::endProfile(__METHOD__ . '|imap_append', 'Mail|IMAP');
                Severity: Minor
                Found in app/Mailer.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 sendByRowQueue uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            $update['status'] = 2;
                            $update['error'] = implode(PHP_EOL, static::$error);
                            $db->createCommand()->update('s_#__mail_queue', $update, ['id' => $rowQueue['id']])->execute();
                        }
                Severity: Minor
                Found in app/Mailer.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\Log' in method 'saveMail'.
                Open

                            Log::error('Mailer Error: IMAP error - ' . imap_last_error(), 'Mailer');
                Severity: Minor
                Found in app/Mailer.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 sendByRowQueue uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            foreach (Json::decode($rowQueue['to']) as $email => $name) {
                                if (is_numeric($email)) {
                                    $email = $name;
                                    $name = '';
                Severity: Minor
                Found in app/Mailer.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\Utils' in method 'saveMail'.
                Open

                        $folder = Utils::convertCharacterEncoding($this->smtp['smtp_folder'], 'UTF-8', 'UTF7-IMAP');
                Severity: Minor
                Found in app/Mailer.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\Mail' in method 'sendByRowQueue'.
                Open

                                $attachments = array_merge($attachments, Mail::getAttachmentsFromDocument($attachments['ids']));
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'sendByRowQueue'.
                Open

                            foreach (Json::decode($rowQueue['to']) as $email => $name) {
                Severity: Minor
                Found in app/Mailer.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\Db' in method 'sendByRowQueue'.
                Open

                        $db = Db::getInstance('admin');
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'sendByRowQueue'.
                Open

                            foreach (Json::decode($rowQueue['to']) as $email => $name) {
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'sendByRowQueue'.
                Open

                                    $update['to'] = Json::encode($emails);
                Severity: Minor
                Found in app/Mailer.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\Json' in method 'sendByRowQueue'.
                Open

                            $mailer->setCustomParams(Json::decode($rowQueue['params']));
                Severity: Minor
                Found in app/Mailer.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 "content" 6 times.
                Open

                    public static $quoteColumn = ['smtp_id', 'date', 'owner', 'status', 'from', 'subject', 'content', 'to', 'cc', 'bcc', 'attachments', 'priority'];
                Severity: Critical
                Found in app/Mailer.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 "Mail|SMTP" 3 times.
                Open

                        \App\Log::beginProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Critical
                Found in app/Mailer.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 "params" 5 times.
                Open

                    public static $quoteJsonColumn = ['from', 'to', 'cc', 'bcc', 'attachments', 'params'];
                Severity: Critical
                Found in app/Mailer.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 "smtp_id" 10 times.
                Open

                    public static $quoteColumn = ['smtp_id', 'date', 'owner', 'status', 'from', 'subject', 'content', 'to', 'cc', 'bcc', 'attachments', 'priority'];
                Severity: Critical
                Found in app/Mailer.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 "priority" 7 times.
                Open

                    public static $quoteColumn = ['smtp_id', 'date', 'owner', 'status', 'from', 'subject', 'content', 'to', 'cc', 'bcc', 'attachments', 'priority'];
                Severity: Critical
                Found in app/Mailer.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 "admin" 4 times.
                Open

                        static::insertMail($params, 'admin');
                Severity: Critical
                Found in app/Mailer.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 "error" 5 times.
                Open

                                if (false !== stripos($str, 'error') || false !== stripos($str, 'failed')) {
                Severity: Critical
                Found in app/Mailer.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 "error_code" 3 times.
                Open

                            $params['error_code'] = 1;
                Severity: Critical
                Found in app/Mailer.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 "owner" 3 times.
                Open

                    public static $quoteColumn = ['smtp_id', 'date', 'owner', 'status', 'from', 'subject', 'content', 'to', 'cc', 'bcc', 'attachments', 'priority'];
                Severity: Critical
                Found in app/Mailer.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 "Mailer" 14 times.
                Open

                                    Log::error(trim($str), 'Mailer');
                Severity: Critical
                Found in app/Mailer.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 "subject" 7 times.
                Open

                    public static $quoteColumn = ['smtp_id', 'date', 'owner', 'status', 'from', 'subject', 'content', 'to', 'cc', 'bcc', 'attachments', 'priority'];
                Severity: Critical
                Found in app/Mailer.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 "attachments" 10 times.
                Open

                    public static $quoteJsonColumn = ['from', 'to', 'cc', 'bcc', 'attachments', 'params'];
                Severity: Critical
                Found in app/Mailer.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 "recordModel" 4 times.
                Open

                        if (empty($params['recordModel'])) {
                Severity: Critical
                Found in app/Mailer.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.

                Remove the unused function parameter "$level".
                Open

                            $this->mailer->Debugoutput = function ($str, $level) {
                Severity: Major
                Found in app/Mailer.php by sonar-php

                Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

                Noncompliant Code Example

                function doSomething($a, $b) { // "$a" is unused
                  return compute($b);
                }
                

                Compliant Solution

                function doSomething($b) {
                  return compute($b);
                }
                

                Exceptions

                Functions in classes that override a class or implement interfaces are ignored.

                class C extends B {
                
                  function doSomething($a, $b) {     // no issue reported on $b
                    compute($a);
                  }
                
                }
                

                See

                • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
                • MISRA C:2012, 2.7 - There should be no unused parameters in functions
                • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
                • CERT, MSC12-CPP. - Detect and remove code that has no effect

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

                    public static $quoteColumn = ['smtp_id', 'date', 'owner', 'status', 'from', 'subject', 'content', 'to', 'cc', 'bcc', 'attachments', 'priority'];
                Severity: Critical
                Found in app/Mailer.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.

                Remove the unused function parameter "$level".
                Open

                        $this->mailer->Debugoutput = function ($str, $level) {
                Severity: Major
                Found in app/Mailer.php by sonar-php

                Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

                Noncompliant Code Example

                function doSomething($a, $b) { // "$a" is unused
                  return compute($b);
                }
                

                Compliant Solution

                function doSomething($b) {
                  return compute($b);
                }
                

                Exceptions

                Functions in classes that override a class or implement interfaces are ignored.

                class C extends B {
                
                  function doSomething($a, $b) {     // no issue reported on $b
                    compute($a);
                  }
                
                }
                

                See

                • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
                • MISRA C:2012, 2.7 - There should be no unused parameters in functions
                • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
                • CERT, MSC12-CPP. - Detect and remove code that has no effect

                Add a "case default" clause to this "switch" statement.
                Open

                            switch ($this->smtp['priority']) {
                Severity: Critical
                Found in app/Mailer.php by sonar-php

                The requirement for a final case default clause is defensive programming. The clause should either take appropriate action, or contain a suitable comment as to why no action is taken. Even when the switch covers all current values of an enum, a default case should still be used because there is no guarantee that the enum won't be extended.

                Noncompliant Code Example

                switch ($param) {  //missing default clause
                  case 0:
                    do_something();
                    break;
                  case 1:
                    do_something_else();
                    break;
                }
                
                switch ($param) {
                  default: // default clause should be the last one
                    error();
                    break;
                  case 0:
                    do_something();
                    break;
                  case 1:
                    do_something_else();
                    break;
                }
                

                Compliant Solution

                switch ($param) {
                  case 0:
                    do_something();
                    break;
                  case 1:
                    do_something_else();
                    break;
                  default:
                    error();
                    break;
                }
                

                See

                • MISRA C:2004, 15.0 - The MISRA C switch syntax shall be used.
                • MISRA C:2004, 15.3 - The final clause of a switch statement shall be the default clause
                • MISRA C++:2008, 6-4-3 - A switch statement shall be a well-formed switch statement.
                • MISRA C++:2008, 6-4-6 - The final clause of a switch statement shall be the default-clause
                • MISRA C:2012, 16.1 - All switch statements shall be well-formed
                • MISRA C:2012, 16.4 - Every switch statement shall have a default label
                • MISRA C:2012, 16.5 - A default label shall appear as either the first or the last switch label of a switch statement
                • MITRE, CWE-478 - Missing Default Case in Switch Statement
                • CERT, MSC01-C. - Strive for logical completeness
                • CERT, MSC01-CPP. - Strive for logical completeness

                Define a constant instead of duplicating this literal "s_#__mail_queue" 3 times.
                Open

                        \App\Db::getInstance($type)->createCommand()->insert('admin' === $type ? 's_#__mail_queue' : 'l_#__mail', $params)->execute();
                Severity: Critical
                Found in app/Mailer.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.

                Avoid unused parameters such as '$level'.
                Open

                        $this->mailer->Debugoutput = function ($str, $level) {
                Severity: Minor
                Found in app/Mailer.php by phpmd

                UnusedFormalParameter

                Since: 0.2

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

                Example

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

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

                Avoid unused parameters such as '$level'.
                Open

                            $this->mailer->Debugoutput = function ($str, $level) {
                Severity: Minor
                Found in app/Mailer.php by phpmd

                UnusedFormalParameter

                Since: 0.2

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

                Example

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

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

                Reference to instance property Debugoutput from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->Debugoutput = function ($str, $level) {
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method decode from undeclared class \App\Utils\Completions
                Open

                        $params['content'] = $textParser->setContent(\App\Utils\Completions::decode(\App\Purifier::purifyHtml($template['content'])))->parse()->getContent();
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method AddCustomHeader from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->AddCustomHeader('List-Unsubscribe', $unsubscribe);
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property Subject from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->params['subject'] = $this->mailer->Subject = $subject;
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method addCC from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->addCC($address, $name);
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method getToAddresses from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $toAddresses = $this->mailer->From . ' >> ' . \print_r($this->mailer->getToAddresses(), true);
                Severity: Critical
                Found in app/Mailer.php by phan

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

                            Encryption::getInstance()->decrypt($this->smtp['smtp_password']),
                Severity: Critical
                Found in app/Mailer.php by phan

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

                            Log::warning('No SMTP configuration', 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property From from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->From = $this->smtp['from_email'] ?: $this->smtp['username'];
                Severity: Minor
                Found in app/Mailer.php by phan

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

                        Log::error('Mailer Error: ' . \print_r($this->mailer->ErrorInfo, true), 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

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

                            Log::warning('No mail template', 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Argument 2 (objectDecodeType) is true but \App\Json::decode() takes int defined at /code/app/Json.php:37
                Open

                            $this->mailer->SMTPOptions = Json::decode($this->smtp['options'], true);
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method addReplyTo from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->addReplyTo($this->smtp['reply_to']);
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method AddCustomHeader from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                                $this->mailer->AddCustomHeader('Importance', $priorityName);
                Severity: Critical
                Found in app/Mailer.php by phan

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

                        \App\Log::beginProfile(__METHOD__ . '|imap_append', 'Mail|IMAP');
                Severity: Critical
                Found in app/Mailer.php by phan

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

                            Log::warning('No target email address provided', 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property ConfirmReadingTo from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->ConfirmReadingTo = $this->smtp['confirm_reading_to'];
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method msgHTML from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->msgHTML($message);
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property Ical from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->Ical = $this->params['ics'];
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property Host from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->Host = $this->smtp['host'];
                Severity: Minor
                Found in app/Mailer.php by phan

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

                        $this->mailer->Password = trim(Encryption::getInstance()->decrypt($this->smtp['password']));
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method AddCustomHeader from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                                $this->mailer->AddCustomHeader('Priority', $priority);
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property FromName from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->FromName = $name;
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method addAddress from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->addAddress($address, $name);
                Severity: Critical
                Found in app/Mailer.php by phan

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

                        \App\Log::beginProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property Hostname from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->Hostname = 'YetiForceCRM';
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method getSentMIMEMessage from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        imap_append($mbox, \OSSMail_Record_Model::$imapConnectMailbox, $this->mailer->getSentMIMEMessage(), '\\Seen');
                Severity: Critical
                Found in app/Mailer.php by phan

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

                                    Log::error(trim($str), 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

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

                            Log::warning('SMTP configuration with provided id not exists', 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method isQmail from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                                $this->mailer->isQmail();
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property SMTPSecure from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->SMTPSecure = $this->smtp['secure'];
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method AddCustomHeader from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->AddCustomHeader('Organization', $this->smtp['organization']);
                Severity: Critical
                Found in app/Mailer.php by phan

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

                            \App\Log::endProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Critical
                Found in app/Mailer.php by phan

                Property \App\Mailer->mailer has undeclared type \PHPMailer\PHPMailer\PHPMailer
                Open

                    protected $mailer;
                Severity: Minor
                Found in app/Mailer.php by phan

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

                                    Log::trace(trim($str), 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property FromName from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->FromName = 'YetiForce Mailer';
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property CharSet from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->CharSet = \App\Config::main('default_charset');
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method getInstanceByModel from undeclared class \App\TextParser (Did you mean class \Tests\App\TextParser)
                Open

                        $textParser = $recordModel ? TextParser::getInstanceByModel($recordModel) : TextParser::getInstance($params['moduleName'] ?? '');
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property Password from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->Password = trim(Encryption::getInstance()->decrypt($this->smtp['password']));
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method addBCC from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->addBCC($address, $name);
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to undeclared method \App\Db::createCommand
                Open

                            $db->createCommand()->delete('s_#__mail_queue', ['id' => $rowQueue['id']])->execute();
                Severity: Critical
                Found in app/Mailer.php by phan

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

                        Log::trace('Send mail from template', 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property Port from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->Port = $this->smtp['port'];
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property Username from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->Username = trim($this->smtp['username']);
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property From from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $toAddresses = $this->mailer->From . ' >> ' . \print_r($this->mailer->getToAddresses(), true);
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method send from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        if ($this->mailer->send()) {
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property ErrorInfo from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        if (\is_array($this->mailer->ErrorInfo)) {
                Severity: Minor
                Found in app/Mailer.php by phan

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

                                Log::error(trim($str), 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method __construct from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer = new \PHPMailer\PHPMailer\PHPMailer(false);
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property XMailer from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->XMailer = 'YetiForceCRM Mailer';
                Severity: Minor
                Found in app/Mailer.php by phan

                Parameter $message has undeclared type \App\text
                Open

                    public function content($message)
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property From from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->From = $address;
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method addReplyTo from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->addReplyTo($address, $name);
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method addAttachment from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->addAttachment($path, $name);
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property ErrorInfo from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            static::$error[] = $this->mailer->ErrorInfo;
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to undeclared method \App\Db::createCommand
                Open

                        \App\Db::getInstance($type)->createCommand()->insert('admin' === $type ? 's_#__mail_queue' : 'l_#__mail', $params)->execute();
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method isSendmail from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                                $this->mailer->isSendmail();
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property SMTPAuth from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->SMTPAuth = isset($this->smtp['authentication']) && (bool) $this->smtp['authentication'];
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property Debugoutput from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->Debugoutput = function ($str, $level) {
                Severity: Minor
                Found in app/Mailer.php by phan

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

                                Log::trace(trim($str), 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

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

                            Log::error('Mailer Error: IMAP error - ' . imap_last_error(), 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property SMTPDebug from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->SMTPDebug = 2;
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to method getInstance from undeclared class \App\TextParser (Did you mean class \Tests\App\TextParser)
                Open

                        $textParser = $recordModel ? TextParser::getInstanceByModel($recordModel) : TextParser::getInstance($params['moduleName'] ?? '');
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method getCurrentUserRealId from undeclared class \App\User (Did you mean class \Tests\App\User)
                Open

                            $owner = User::getCurrentUserRealId();
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method isMail from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                                $this->mailer->isMail();
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method AddCustomHeader from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                                $this->mailer->AddCustomHeader('X-MSMail-Priority', $priorityName);
                Severity: Critical
                Found in app/Mailer.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/Mailer.php by phan

                Call to method getInstanceById from undeclared class \App\TextParser (Did you mean class \Tests\App\TextParser)
                Open

                        $textParser = TextParser::getInstanceById($currentUser->getId(), 'Users');
                Severity: Critical
                Found in app/Mailer.php by phan

                Argument 1 (stream_id) is \IMAP\Connection|false but \imap_append() takes resource
                Open

                        imap_append($mbox, \OSSMail_Record_Model::$imapConnectMailbox, $this->mailer->getSentMIMEMessage(), '\\Seen');
                Severity: Minor
                Found in app/Mailer.php by phan

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

                            Log::trace('Mailer sent mail', 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property ErrorInfo from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        Log::error('Mailer Error: ' . \print_r($this->mailer->ErrorInfo, true), 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property ErrorInfo from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            foreach ($this->mailer->ErrorInfo as $error) {
                Severity: Minor
                Found in app/Mailer.php by phan

                Call to undeclared method \App\Db::createCommand
                Open

                            $db->createCommand()->update('s_#__mail_queue', $update, ['id' => $rowQueue['id']])->execute();
                Severity: Critical
                Found in app/Mailer.php by phan

                Reference to instance property SMTPOptions from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->SMTPOptions = Json::decode($this->smtp['options'], true);
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property FromName from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                            $this->mailer->FromName = $this->smtp['from_name'];
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property Priority from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                                $this->mailer->Priority = $priorityX;
                Severity: Minor
                Found in app/Mailer.php by phan

                Reference to instance property SMTPDebug from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->SMTPDebug = 2;
                Severity: Minor
                Found in app/Mailer.php by phan

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

                        \App\Log::endProfile(__METHOD__ . '|imap_append', 'Mail|IMAP');
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method isSMTP from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                                $this->mailer->isSMTP();
                Severity: Critical
                Found in app/Mailer.php by phan

                Call to method isHTML from undeclared class \PHPMailer\PHPMailer\PHPMailer
                Open

                        $this->mailer->isHTML(true);
                Severity: Critical
                Found in app/Mailer.php by phan

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

                        \App\Log::endProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Critical
                Found in app/Mailer.php by phan

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

                            Log::error('Mailer Error: No smtp data entered', 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

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

                            Log::warning('No template', 'Mailer');
                Severity: Critical
                Found in app/Mailer.php by phan

                Avoid using short method names like Mailer::cc(). The configured minimum method name length is 3.
                Open

                    public function cc($address, $name = '')
                    {
                        $this->params['cc'][$address] = $name;
                        $this->mailer->addCC($address, $name);
                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpmd

                ShortMethodName

                Since: 0.2

                Detects when very short method names are used.

                Example

                class ShortMethod {
                    public function a( $index ) { // Violation
                    }
                }

                Source https://phpmd.org/rules/naming.html#shortmethodname

                Avoid using short method names like Mailer::to(). The configured minimum method name length is 3.
                Open

                    public function to($address, $name = '')
                    {
                        $this->params['to'][$address] = $name;
                        $this->mailer->addAddress($address, $name);
                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpmd

                ShortMethodName

                Since: 0.2

                Detects when very short method names are used.

                Example

                class ShortMethod {
                    public function a( $index ) { // Violation
                    }
                }

                Source https://phpmd.org/rules/naming.html#shortmethodname

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

                        $db = Db::getInstance('admin');
                Severity: Minor
                Found in app/Mailer.php by phpmd

                ShortVariable

                Since: 0.2

                Detects when a field, local, or parameter has a very short name.

                Example

                class Something {
                    private $q = 15; // VIOLATION - Field
                    public static function main( array $as ) { // VIOLATION - Formal
                        $r = 20 + $this->q; // VIOLATION - Local
                        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                            $r += $this->q;
                        }
                    }
                }

                Source https://phpmd.org/rules/naming.html#shortvariable

                Only one argument is allowed per line in a multi-line function call
                Open

                            $this->smtp['smtp_host'] . ':' . $this->smtp['smtp_port'], $folder, false,
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Only one argument is allowed per line in a multi-line function call
                Open

                            $this->smtp['smtp_host'] . ':' . $this->smtp['smtp_port'], $folder, false,
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        1 => 'LBL_WAITING_TO_BE_SENT',
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param int $smtpId Smtp ID
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->FromName = 'YetiForce Mailer';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public static $statuses = [
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public static $quoteColumn = ['smtp_id', 'date', 'owner', 'status', 'from', 'subject', 'content', 'to', 'cc', 'bcc', 'attachments', 'priority'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->SMTPDebug = 2;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    Log::error(trim($str), 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function loadSmtpByID($smtpId)
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                if (false !== stripos($str, 'error') || false !== stripos($str, 'failed')) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->CharSet = \App\Config::main('default_charset');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->setSmtp();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                } else {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param array $smtpInfo
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        0 => 'LBL_PENDING_ACCEPTANCE',
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public static $quoteJsonColumn = ['from', 'to', 'cc', 'bcc', 'attachments', 'params'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    protected $mailer;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /** @var string[] Columns list that require JSON formatting */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /** @var \PHPMailer\PHPMailer\PHPMailer PHPMailer instance */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    protected $params = [];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Construct.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    Log::trace(trim($str), 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /** @var string[] Columns list available in the database */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /** @var array SMTP configuration */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

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

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

                            };
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->Hostname = 'YetiForceCRM';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /** @var array Parameters for sending messages */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->smtp = $smtpInfo;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /** @var array Error logs */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        static::$error = [];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    static::$error[] = $str;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer = new \PHPMailer\PHPMailer\PHPMailer(false);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->smtp = Mail::getSmtpById($smtpId);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param array $params
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /** @var string[] Queue status */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    ];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 148 characters
                Open

                    public static $quoteColumn = ['smtp_id', 'date', 'owner', 'status', 'from', 'subject', 'content', 'to', 'cc', 'bcc', 'attachments', 'priority'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->XMailer = 'YetiForceCRM Mailer';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        2 => 'LBL_ERROR_DURING_SENDING',
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (\App\Config::debug('MAILER_DEBUG')) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->Debugoutput = function ($str, $level) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Load configuration smtp by id.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->setSmtp();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    protected $smtp;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public static $error;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Load configuration smtp.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function loadSmtp($smtpInfo)
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            Log::warning('No mail template', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $params['subject'] = $textParser->setContent($template['subject'])->parse()->getContent();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $params['error_code'] = 2;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $textParser = $recordModel ? TextParser::getInstanceByModel($recordModel) : TextParser::getInstance($params['moduleName'] ?? '');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return bool
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $params['status'] = Config::component('Mail', 'MAILER_REQUIRED_ACCEPTATION_BEFORE_SENDING') ? 0 : 1;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (empty($params['owner'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            unset($params['priority'], $params['status']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            Log::warning('No target email address provided', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 134 characters
                Open

                        \App\Db::getInstance($type)->createCommand()->insert('admin' === $type ? 's_#__mail_queue' : 'l_#__mail', $params)->execute();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return $this->smtp[$key];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        } else {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $textParser->setSourceRecord($params['sourceRecord'], $params['sourceModule']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $params['owner'] = $owner ?: 0;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!\App\Mail::getSmtpById($params['smtp_id'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (empty($params['to'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            static::insertMail($params, 'log');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        foreach (static::$quoteJsonColumn as $key) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        \App\Db::getInstance($type)->createCommand()->insert('admin' === $type ? 's_#__mail_queue' : 'l_#__mail', $params)->execute();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return bool
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            if (isset($params['recordId'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $textParser->setLanguage($params['language']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $owner = User::getCurrentUserRealId();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $params['smtp_id'] = Mail::getDefaultSmtp();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function getSmtp(?string $key = null)
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            case 'smtp':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 136 characters
                Open

                            $params['attachments'] = array_merge(empty($params['attachments']) ? [] : $params['attachments'], $template['attachments']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $params['error_code'] = 1;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string|null $key
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        Log::trace('Send mail from template', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (empty($params['recordModel'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!empty($params['sourceRecord'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $params['content'] = $textParser->setContent(\App\Utils\Completions::decode(\App\Purifier::purifyHtml($template['content'])))->parse()->getContent();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return false;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $params[$key] = [$params[$key]];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this->smtp;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!$this->smtp) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (empty($params['template'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            Log::warning('No template', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $template = Mail::getTemplate($params['template']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $textParser->setParams(array_diff_key($params, array_flip(['subject', 'content', 'attachments', 'recordModel'])));
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $recordModel = false;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $moduleName = $params['moduleName'] ?? null;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $recordModel = $params['recordModel'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 157 characters
                Open

                        $params['content'] = $textParser->setContent(\App\Utils\Completions::decode(\App\Purifier::purifyHtml($template['content'])))->parse()->getContent();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        unset($textParser);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (isset($template['attachments'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Set configuration smtp in mailer.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            case 'sendmail':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $recordModel = \Vtiger_Record_Model::getInstanceById($params['recordId'], $moduleName);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Add mail to quote for send.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public static function addMail(array $params): bool
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (empty($params['smtp_id'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return false;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $eventHandler->trigger('admin' === $type ? 'MailerAddToQueue' : 'MailerAddToLogs');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function setSmtp(): void
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        switch ($this->smtp['mailer_type']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            case 'mail':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            unset($params['recordModel']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $params['smtp_id'] = $template['smtp_id'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $params['date'] = date('Y-m-d H:i:s');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            unset($params['priority'], $params['status']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            Log::warning('No SMTP configuration', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                if (!\is_array($params[$key])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $params[$key] = Json::encode($params[$key]);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            throw new \App\Exceptions\AppException('ERR_NO_SMTP_CONFIGURATION');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $this->mailer->isSendmail();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (empty($params['smtp_id']) && !empty($template['smtp_id'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            static::insertMail($params, 'log');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public static function insertMail(array $params, string $type): void
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                break;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return false;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 137 characters
                Open

                        $textParser = $recordModel ? TextParser::getInstanceByModel($recordModel) : TextParser::getInstance($params['moduleName'] ?? '');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 122 characters
                Open

                        $textParser->setParams(array_diff_key($params, array_flip(['subject', 'content', 'attachments', 'recordModel'])));
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $params['priority'] = $template['email_template_priority'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $row['params'] = array_diff_key($params, $row);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param array $params
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        static::insertMail($params, 'admin');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param array  $params
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $this->mailer->isSMTP();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            static::insertMail($params, 'log');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return false;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return true;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return void
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $eventHandler->setParams($params);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return mixed
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($key && isset($this->smtp[$key])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!$template) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return false;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $params['attachments'] = array_merge(empty($params['attachments']) ? [] : $params['attachments'], $template['attachments']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $row = array_intersect_key($params, array_flip(self::$quoteColumn));
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $type   'admin' | 'log'
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $eventHandler = new EventHandler();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $params = $eventHandler->getParams();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            if (isset($params[$key])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Get configuration smtp.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                break;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $this->mailer->isMail();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public static function sendFromTemplate(array $params): bool
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return static::addMail($row);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            unset($params['priority'], $params['status']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            Log::warning('SMTP configuration with provided id not exists', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $params['error_code'] = 3;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Save mail data in provided table.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!empty($params['language'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!empty($template['email_template_priority'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (empty($params['smtp_id'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($this->smtp['reply_to']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $this->mailer->AddCustomHeader('X-MSMail-Priority', $priorityName);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Creates a message from an HTML string, making modifications for inline images and backgrounds and creates a plain-text version by converting the HTML.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 157 characters
                Open

                     * Creates a message from an HTML string, making modifications for inline images and backgrounds and creates a plain-text version by converting the HTML.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $name
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Add a "BCC" address.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $unsubscribe = '';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($this->smtp['priority']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $priorityName = 'Low';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                        $priorityX = 1;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->ConfirmReadingTo = $this->smtp['confirm_reading_to'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->AddCustomHeader('Organization', $this->smtp['organization']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->From = $address;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Add a "To" address.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->addAddress($address, $name);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    break;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @see \PHPMailer::MsgHTML()
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $address The email address to send to
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($this->smtp['unsubscribe']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                case 'urgent':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

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

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $name
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            case 'qmail':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->From = $this->smtp['from_email'] ?: $this->smtp['username'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            foreach (\App\Json::decode($this->smtp['unsubscribe']) as $row) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $unsubscribe = rtrim($unsubscribe, ',');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $priorityX = 5;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $this->mailer->Priority = $priorityX;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function cc($address, $name = '')
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                break;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->SMTPOptions = Json::decode($this->smtp['options'], true);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->AddCustomHeader('List-Unsubscribe', $unsubscribe);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $this->mailer->AddCustomHeader('Importance', $priorityName);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param text $message
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 178 characters
                Open

                            $message .= '<table style="font-size:9px;width:100%; margin: 0;"><tbody><tr><td style="width:50%;text-align: center;">Powered by YetiForce</td></tr></tbody></table>';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->params['cc'][$address] = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->SMTPAuth = isset($this->smtp['authentication']) && (bool) $this->smtp['authentication'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->Password = trim(Encryption::getInstance()->decrypt($this->smtp['password']));
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                        $priorityName = 'High';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Set subject.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->FromName = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->Username = trim($this->smtp['username']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    break;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $message .= '<table style="font-size:9px;width:100%; margin: 0;"><tbody><tr><td style="width:50%;text-align: center;">Powered by YetiForce</td></tr></tbody></table>';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->addCC($address, $name);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                break;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($this->smtp['organization']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function subject($subject)
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Set the From and FromName properties.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $priorityName = $priority = $priorityX = null;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                case 'normal':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                case 'non-urgent':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    break;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

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

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

                    public function from($address, $name = '')
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $name
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function to($address, $name = '')
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                break;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->addReplyTo($this->smtp['reply_to']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                        $priority = 'Urgent';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $this->mailer->isQmail();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            default:
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                case 'Normal':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                case 'High':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            if ($priority) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $this->mailer->AddCustomHeader('Priority', $priority);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->Host = $this->smtp['host'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->Port = $this->smtp['port'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($this->smtp['from_name']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function content($message)
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->params['from'][$address] = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $priorityX = 3;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                case 'Low':
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->params['subject'] = $this->mailer->Subject = $subject;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->params['body'] = $message;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $address
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->params['to'][$address] = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($this->smtp['options']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->FromName = $this->smtp['from_name'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $unsubscribe .= "<$row>,";
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($this->smtp['confirm_reading_to']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->isHTML(true);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->SMTPSecure = $this->smtp['secure'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            switch ($this->smtp['priority']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!empty($this->smtp['port'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $priority = $priorityName = 'Normal';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $priority = 'Non-Urgent';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $subject
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->msgHTML($message);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $address The email address to send to
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Add a "CC" address.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $name
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        static::$error = [];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return bool
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $attachments = Json::decode($rowQueue['attachments']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Check connection.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                        $name = '';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $attachmentsToRemove = $update = [];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function bcc($address, $name = '')
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $name
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $name Overrides the attachment name
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $eventHandler->setParams(['mailer' => $this]);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $eventHandler->trigger('MailerAfterSend');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        Log::error('Mailer Error: ' . \print_r($this->mailer->ErrorInfo, true), 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->Debugoutput = function ($str, $level) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    if (is_numeric($email)) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($this->mailer->send()) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function test()
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return true;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return false;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $mailer->attachment($path, $name);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return array
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                Log::error(trim($str), 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                Log::trace(trim($str), 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!$templateId) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return ['result' => false, 'error' => Language::translate('LBL_NO_EMAIL_TEMPLATE')];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->content($textParser->setContent($template['content'])->parse()->getContent());
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 129 characters
                Open

                        $mailer = (new self())->loadSmtpByID($rowQueue['smtp_id'])->subject($rowQueue['subject'])->content($rowQueue['content']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!empty(static::$error)) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            if (false !== strpos(strtolower($str), 'error') || false !== strpos(strtolower($str), 'failed')) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        };
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $currentUser = \Users_Record_Model::getCurrentUserModel();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->to($currentUser->get('email1'));
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public static function sendByRowQueue($rowQueue)
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $mailer = (new self())->loadSmtpByID($rowQueue['smtp_id'])->subject($rowQueue['subject'])->content($rowQueue['content']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                        $email = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $mailer->{$key}($email, $name);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $address The email address to reply to
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        \App\Log::beginProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $this->saveMail();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->SMTPDebug = 2;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param array $rowQueue
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $mailer->from($from['email'], $from['name']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

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

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

                        if ($rowQueue['attachments']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $attachments = array_merge($attachments, Mail::getAttachmentsFromDocument($attachments['ids']));
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                if (strpos(realpath($path), 'cache' . \DIRECTORY_SEPARATOR)) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->params['attachment'][$path] = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->addAttachment($path, $name);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (\is_array($this->mailer->ErrorInfo)) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            static::$error[] = $this->mailer->ErrorInfo;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->subject($textParser->setContent($template['subject'])->parse()->getContent());
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return ['result' => $this->send(), 'error' => implode(PHP_EOL, static::$error)];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return true;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            if ($rowQueue[$key]) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        } else {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Add a "Reply-To" address.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            } else {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $path Path to the attachment
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            \App\Log::endProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            Log::trace('Mailer sent mail', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                foreach (Json::decode($rowQueue[$key]) as $email => $name) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                unset($attachments['ids']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            foreach ($attachments as $path => $name) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $name = '';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->addBCC($address, $name);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function attachment($path, $name = '')
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Create a message and send it.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $template = Mail::getTemplate($templateId);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function replyTo($address, $name = '')
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $eventHandler->trigger('MailerBeforeSend');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            static::$error[] = '########################################';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                static::$error[] = trim($str);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $textParser = TextParser::getInstanceById($currentUser->getId(), 'Users');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        foreach (['cc', 'bcc'] as $key) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->params['replyTo'][$address] = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->mailer->addReplyTo($address, $name);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $eventHandler = new EventHandler();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            foreach ($this->mailer->ErrorInfo as $error) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Send mail by row queue.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($rowQueue['from']) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param string $address The email address to send to
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return $this mailer object itself
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Add an attachment from a path on the filesystem.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function send(): bool
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                if (is_numeric($path)) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return bool
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $toAddresses = $this->mailer->From . ' >> ' . \print_r($this->mailer->getToAddresses(), true);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            if (!empty($this->smtp['save_send_mail'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        \App\Log::endProfile("Mailer::send|{$toAddresses}", 'Mail|SMTP');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                static::$error[] = $error;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $eventHandler->trigger('MailerAfterSendError');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ('demo' === \App\Config::main('systemMode')) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            if (isset($attachments['ids'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $path = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->params['bcc'][$address] = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $templateId = Mail::getTemplateIdFromSysName('TestMailAboutTheMailServerConfiguration');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $from = Json::decode($rowQueue['from']);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->mailer->Ical = $this->params['ics'];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                'imap_open_add_connection_type' => true,
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return \App\Mailer
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            foreach ($emails as $email => $name) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $update['status'] = 2;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (isset($this->params['ics'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            Log::error('Mailer Error: No smtp data entered', 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $update['to'] = Json::encode($emails);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        } else {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        imap_append($mbox, \OSSMail_Record_Model::$imapConnectMailbox, $this->mailer->getSentMIMEMessage(), '\\Seen');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $separateMailer->to($email, $name);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $db->createCommand()->update('s_#__mail_queue', $update, ['id' => $rowQueue['id']])->execute();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function setCustomParams(array $params): void
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            ]
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        \App\Log::beginProfile(__METHOD__ . '|imap_append', 'Mail|IMAP');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $attachmentsToRemove[] = $path;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                if (is_numeric($email)) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $email = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $this->params['params'] = $params;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return array
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                Line exceeds 120 characters; contains 124 characters
                Open

                        if (empty($this->smtp['smtp_username']) && empty($this->smtp['smtp_password']) && empty($this->smtp['smtp_host'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->smtp['smtp_username'],
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return false;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function cloneMailer()
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Adding additional parameters.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function saveMail()
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                unlink($file);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $update['error'] = implode(PHP_EOL, static::$error);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @param array $params
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $this->params;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            return false;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            Log::error('Mailer Error: IMAP error - ' . imap_last_error(), 'Mailer');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $clonedThis = clone $this;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $mailer->to($email, $name);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($status) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (empty($this->smtp['smtp_username']) && empty($this->smtp['smtp_password']) && empty($this->smtp['smtp_host'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                'imap_params' => [],
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $email = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $status = $separateMailer->send();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                if (!$status) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                if (is_numeric($email)) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $name = '';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $status;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $folder = Utils::convertCharacterEncoding($this->smtp['smtp_folder'], 'UTF-8', 'UTF7-IMAP');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $this->smtp['smtp_host'] . ':' . $this->smtp['smtp_port'], $folder, false,
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (!empty($rowQueue['params'])) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $emails[$email] = $name;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            foreach (Json::decode($rowQueue['to']) as $email => $name) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return void
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            static::$error[] = 'IMAP error - ' . imap_last_error();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        \App\Log::endProfile(__METHOD__ . '|imap_append', 'Mail|IMAP');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Clone the mailer object for individual shipment.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return $clonedThis;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            foreach (Json::decode($rowQueue['to']) as $email => $name) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    $name = '';
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $status = $mailer->send();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Save sent email.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            Encryption::getInstance()->decrypt($this->smtp['smtp_password']),
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if ($mailer->getSmtp('individual_delivery')) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                $separateMailer = $mailer->cloneMailer();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                    break;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        } else {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $db = Db::getInstance('admin');
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    public function getCustomParams(): array
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $mbox = \OSSMail_Record_Model::imapConnect(
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * Get additional parameters.
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            [
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        );
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     *
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            foreach ($attachmentsToRemove as $file) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @return bool
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                'imap_max_retries' => 0,
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        return true;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        $clonedThis->mailer = clone $this->mailer;
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $mailer->setCustomParams(Json::decode($rowQueue['params']));
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $emails = [];
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                unset($separateMailer, $emails[$email]);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            unset($mailer);
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                            $db->createCommand()->delete('s_#__mail_queue', ['id' => $rowQueue['id']])->execute();
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                    }
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     * @throws \App\Exceptions\AppException
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                                'validate_cert' => !empty($this->smtp['smtp_validate_cert']),
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                        if (false === $mbox && !imap_last_error()) {
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

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

                     */
                Severity: Minor
                Found in app/Mailer.php by phpcodesniffer

                There are no issues that match your filters.

                Category
                Status