YetiForceCompany/YetiForceCRM

View on GitHub
app/Purifier.php

Summary

Maintainability
F
4 days
Test Coverage
B
82%

Function purifyByType has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
Open

    public static function purifyByType($input, $type, $convert = false)
    {
        if (\is_array($input)) {
            $value = [];
            foreach ($input as $k => $v) {
Severity: Minor
Found in app/Purifier.php - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

File Purifier.php has 426 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Purifier file.
 *
 * @package App
Severity: Minor
Found in app/Purifier.php - About 6 hrs to fix

    Method purifyByType has 145 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function purifyByType($input, $type, $convert = false)
        {
            if (\is_array($input)) {
                $value = [];
                foreach ($input as $k => $v) {
    Severity: Major
    Found in app/Purifier.php - About 5 hrs to fix

      Method getHtmlConfig has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getHtmlConfig(array $options = [])
          {
              $config = \HTMLPurifier_Config::createDefault();
              $config->set('Core.Encoding', static::$defaultCharset);
              $config->set('Cache.SerializerPermissions', 0775);
      Severity: Major
      Found in app/Purifier.php - About 3 hrs to fix

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

        class Purifier
        {
            /** @var string Purify type date in user format. */
            public const DATE_USER_FORMAT = 'DateInUserFormat';
        
        
        Severity: Minor
        Found in app/Purifier.php by phpmd

        Function purify has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function purify($input, $loop = true)
            {
                if (empty($input)) {
                    return $input;
                }
        Severity: Minor
        Found in app/Purifier.php - About 2 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method purify has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function purify($input, $loop = true)
            {
                if (empty($input)) {
                    return $input;
                }
        Severity: Minor
        Found in app/Purifier.php - About 1 hr to fix

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

              public static function purifyHtml(string $input, $loop = true): string
              {
                  if (empty($input)) {
                      return $input;
                  }
          Severity: Minor
          Found in app/Purifier.php - About 1 hr to fix

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

                public static function purifyHtml(string $input, $loop = true): string
                {
                    if (empty($input)) {
                        return $input;
                    }
            Severity: Minor
            Found in app/Purifier.php - About 55 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

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

                public static function purifyTextParser($input, $loop = true): string
                {
                    if (empty($input)) {
                        return $input;
                    }
            Severity: Minor
            Found in app/Purifier.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 purifyByType() has 148 lines of code. Current threshold is set to 100. Avoid really long methods.
            Open

                public static function purifyByType($input, $type, $convert = false)
                {
                    if (\is_array($input)) {
                        $value = [];
                        foreach ($input as $k => $v) {
            Severity: Minor
            Found in app/Purifier.php by phpmd

            The method getHtmlConfig() has 100 lines of code. Current threshold is set to 100. Avoid really long methods.
            Open

                public static function getHtmlConfig(array $options = [])
                {
                    $config = \HTMLPurifier_Config::createDefault();
                    $config->set('Core.Encoding', static::$defaultCharset);
                    $config->set('Cache.SerializerPermissions', 0775);
            Severity: Minor
            Found in app/Purifier.php by phpmd

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

                public static function purifyByType($input, $type, $convert = false)
                {
                    if (\is_array($input)) {
                        $value = [];
                        foreach ($input as $k => $v) {
            Severity: Minor
            Found in app/Purifier.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 purify() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
            Open

                public static function purify($input, $loop = true)
                {
                    if (empty($input)) {
                        return $input;
                    }
            Severity: Minor
            Found in app/Purifier.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

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

                public static function purifyByType($input, $type, $convert = false)
            Severity: Major
            Found in app/Purifier.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 19 to the 15 allowed.
            Open

                public static function purify($input, $loop = true)
            Severity: Critical
            Found in app/Purifier.php by sonar-php

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

            See

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

                public static function purifyByType($input, $type, $convert = false)
            Severity: Critical
            Found in app/Purifier.php by sonar-php

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

            See

            Missing class import via use statement (line '405', column '13').
            Open

                    throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $input, 406);
            Severity: Minor
            Found in app/Purifier.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 '141', column '39').
            Open

                        static::$purifyInstanceCache = new \HTMLPurifier($config);
            Severity: Minor
            Found in app/Purifier.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 '228', column '49').
            Open

                        static::$purifyTextParserInstanceCache = new \HTMLPurifier($config);
            Severity: Minor
            Found in app/Purifier.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 '189', column '43').
            Open

                        static::$purifyHtmlInstanceCache = new \HTMLPurifier($config);
            Severity: Minor
            Found in app/Purifier.php by phpmd

            MissingImport

            Since: 2.7.0

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

            Example

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

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

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

                public static function purifyByType($input, $type, $convert = false)
            Severity: Minor
            Found in app/Purifier.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

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

            Example

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

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

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

                public static function purifyHtml(string $input, $loop = true): string
            Severity: Minor
            Found in app/Purifier.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

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

            Example

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

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

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

                public static function purifyTextParser($input, $loop = true): string
            Severity: Minor
            Found in app/Purifier.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

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

            Example

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

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

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

                public static function purifySql($input, $skipEmpty = true)
            Severity: Minor
            Found in app/Purifier.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

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

            Example

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

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

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

                public static function purify($input, $loop = true)
            Severity: Minor
            Found in app/Purifier.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

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

            Example

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

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

            Missing class import via use statement (line '566', column '15').
            Open

                            throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $input, 406);
            Severity: Minor
            Found in app/Purifier.php by phpmd

            MissingImport

            Since: 2.7.0

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

            Example

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

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

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

                public static function getHtmlConfig(array $options = [])
                {
                    $config = \HTMLPurifier_Config::createDefault();
                    $config->set('Core.Encoding', static::$defaultCharset);
                    $config->set('Cache.SerializerPermissions', 0775);
            Severity: Minor
            Found in app/Purifier.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

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

                public static function purifyByType($input, $type, $convert = false)
                {
                    if (\is_array($input)) {
                        $value = [];
                        foreach ($input as $k => $v) {
            Severity: Minor
            Found in app/Purifier.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

            Avoid using static access to class '\HTMLPurifier_Config' in method 'purify'.
            Open

                        $config = \HTMLPurifier_Config::createDefault();
            Severity: Minor
            Found in app/Purifier.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 '\HTMLPurifier_Config' in method 'getHtmlConfig'.
            Open

                    $config = \HTMLPurifier_Config::createDefault();
            Severity: Minor
            Found in app/Purifier.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 'purifyHtmlEventAttributes'.
            Open

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.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 assigning values to variables in if clauses and the like (line '514', column '21').
            Open

                public static function purifyByType($input, $type, $convert = false)
                {
                    if (\is_array($input)) {
                        $value = [];
                        foreach ($input as $k => $v) {
            Severity: Minor
            Found in app/Purifier.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

            Avoid using static access to class 'App\Cache' in method 'purify'.
            Open

                        if (Cache::has('purify', $cacheKey)) {
            Severity: Minor
            Found in app/Purifier.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 assigning values to variables in if clauses and the like (line '321', column '7').
            Open

                public static function getHtmlConfig(array $options = [])
                {
                    $config = \HTMLPurifier_Config::createDefault();
                    $config->set('Core.Encoding', static::$defaultCharset);
                    $config->set('Cache.SerializerPermissions', 0775);
            Severity: Minor
            Found in app/Purifier.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

            Avoid using static access to class 'App\Cache' in method 'purifyHtml'.
            Open

                        Cache::save('purifyHtml', $cacheKey, $value, Cache::SHORT);
            Severity: Minor
            Found in app/Purifier.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 'purifyHtmlEventAttributes'.
            Open

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.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 purifyByType uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        $value = null;
                        switch ($type) {
                            case 'Standard': // only word
                            case 1:
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = Validator::alnum($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.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\Cache' in method 'purifyHtml'.
            Open

                    if (Cache::has('purifyHtml', $cacheKey)) {
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = Validator::standard($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.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\Cache' in method 'purifyTextParser'.
            Open

                    if (Cache::has('purifyTextParser', $cacheKey)) {
            Severity: Minor
            Found in app/Purifier.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\Cache' in method 'purifyTextParser'.
            Open

                    Cache::save('purifyTextParser', $cacheKey, $value, Cache::SHORT);
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifySql'.
            Open

                    if ((empty($input) && $skipEmpty) || Validator::sql($input)) {
            Severity: Minor
            Found in app/Purifier.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\Cache' in method 'purifyTextParser'.
            Open

                        return Cache::get('purifyTextParser', $cacheKey);
            Severity: Minor
            Found in app/Purifier.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\Cache' in method 'purify'.
            Open

                            return Cache::get('purify', $cacheKey);
            Severity: Minor
            Found in app/Purifier.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\Cache' in method 'purifyHtml'.
            Open

                        return Cache::get('purifyHtml', $cacheKey);
            Severity: Minor
            Found in app/Purifier.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 'purifyHtmlEventAttributes'.
            Open

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.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 assigning values to variables in if clauses and the like (line '509', column '21').
            Open

                public static function purifyByType($input, $type, $convert = false)
                {
                    if (\is_array($input)) {
                        $value = [];
                        foreach ($input as $k => $v) {
            Severity: Minor
            Found in app/Purifier.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

            Avoid using static access to class 'App\Cache' in method 'purify'.
            Open

                            Cache::save('purify', $cacheKey, $value, Cache::SHORT);
            Severity: Minor
            Found in app/Purifier.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 'purifySql'.
            Open

                    \App\Log::error('purifySql: ' . $input, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = Validator::dateInUserFormat($input) ? ($convert ? Fields\Date::formatToDB($input) : $input) : null;
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = Validator::email($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Fields\Date' in method 'purifyByType'.
            Open

                                $value = Validator::dateInUserFormat($input) ? ($convert ? Fields\Date::formatToDB($input) : $input) : null;
            Severity: Minor
            Found in app/Purifier.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Fields\Double' in method 'purifyByType'.
            Open

                                $dbFormat = Fields\Double::formatToDb($input);
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = Validator::url($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = $input && Validator::sql($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                    if (Validator::{$type}($input)) {
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = Validator::path($input) && Validator::path(static::purify($input)) ? $input : null;
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = Validator::timeInUserFormat($input) ? ($convert ? Fields\Time::formatToDB($input) : $input) : null;
            Severity: Minor
            Found in app/Purifier.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Fields\Double' in method 'purifyByType'.
            Open

                                if (is_numeric($dbFormat) && Fields\Double::formatToDisplay($dbFormat, false) === Fields\Double::truncateZeros($input)) {
            Severity: Minor
            Found in app/Purifier.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 'purifyByType'.
            Open

                            \App\Log::error('purifyByType: ' . $input, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Fields\Time' in method 'purifyByType'.
            Open

                                $value = Validator::timeInUserFormat($input) ? ($convert ? Fields\Time::formatToDB($input) : $input) : null;
            Severity: Minor
            Found in app/Purifier.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Fields\Double' in method 'purifyByType'.
            Open

                                $input = Fields\Double::formatToDb($rawInput = $input);
            Severity: Minor
            Found in app/Purifier.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Fields\Double' in method 'purifyByType'.
            Open

                                if (is_numeric($dbFormat) && Fields\Double::formatToDisplay($dbFormat, false) === Fields\Double::truncateZeros($input)) {
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                    if (!Validator::dateInUserFormat($i)) {
            Severity: Minor
            Found in app/Purifier.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Fields\Date' in method 'purifyByType'.
            Open

                                    [$y, $m, $d] = Fields\Date::explode($i, $dateFormat);
            Severity: Minor
            Found in app/Purifier.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 '\DateTimeField' in method 'purifyByType'.
            Open

                                        $v[] = \DateTimeField::convertToDBFormat($i);
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = Validator::dateTimeInIsoFormat($input) ? date('Y-m-d H:i:s', strtotime($input)) : null;
            Severity: Minor
            Found in app/Purifier.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 purifyByType uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                                } else {
                                    $value = self::purify($input);
                                }
            Severity: Minor
            Found in app/Purifier.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\Fields\Double' in method 'purifyByType'.
            Open

                                if (is_numeric($input) && Fields\Double::formatToDisplay($input, false) === Fields\Double::truncateZeros($rawInput)) {
            Severity: Minor
            Found in app/Purifier.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Fields\Double' in method 'purifyByType'.
            Open

                                if (is_numeric($input) && Fields\Double::formatToDisplay($input, false) === Fields\Double::truncateZeros($rawInput)) {
            Severity: Minor
            Found in app/Purifier.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\Validator' in method 'purifyByType'.
            Open

                                $value = Validator::path($input) && Validator::path(static::purify($input)) ? $input : null;
            Severity: Minor
            Found in app/Purifier.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 "width" 3 times.
            Open

                            'width' => 'Length',
            Severity: Critical
            Found in app/Purifier.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 "IllegalValue" 5 times.
            Open

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Critical
            Found in app/Purifier.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 "Inline" 14 times.
            Open

                        $def->addElement('figcaption', 'Inline', 'Flow', 'Common');
            Severity: Critical
            Found in app/Purifier.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 "Length" 6 times.
            Open

                            'width' => 'Length',
            Severity: Critical
            Found in app/Purifier.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 "purifyHtml" 3 times.
            Open

                    if (Cache::has('purifyHtml', $cacheKey)) {
            Severity: Critical
            Found in app/Purifier.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 "height" 4 times.
            Open

                            'height' => 'Length',
            Severity: Critical
            Found in app/Purifier.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 "purifyHtmlEventAttributes: " 3 times.
            Open

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Critical
            Found in app/Purifier.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 "Block" 15 times.
            Open

                        $def->addElement('section', 'Block', 'Flow', 'Common');
            Severity: Critical
            Found in app/Purifier.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 "purify" 3 times.
            Open

                        if (Cache::has('purify', $cacheKey)) {
            Severity: Critical
            Found in app/Purifier.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 "Common" 22 times.
            Open

                        $def->addElement('section', 'Block', 'Flow', 'Common');
            Severity: Critical
            Found in app/Purifier.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 "border" 3 times.
            Open

                        $def->addAttribute('td', 'border', 'Text');
            Severity: Critical
            Found in app/Purifier.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 "purifyTextParser" 3 times.
            Open

                    if (Cache::has('purifyTextParser', $cacheKey)) {
            Severity: Critical
            Found in app/Purifier.php by sonar-php

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

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

            Noncompliant Code Example

            With the default threshold of 3:

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

            Compliant Solution

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

            Exceptions

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

            Property \App\Purifier::$purifyInstanceCache has undeclared type \HTMLPurifier
            Open

                private static $purifyInstanceCache = false;
            Severity: Minor
            Found in app/Purifier.php by phan

            Property \App\Purifier::$purifyTextParserInstanceCache has undeclared type \HTMLPurifier
            Open

                private static $purifyTextParserInstanceCache = false;
            Severity: Minor
            Found in app/Purifier.php by phan

            Call to method createDefault from undeclared class \HTMLPurifier_Config
            Open

                        $config = \HTMLPurifier_Config::createDefault();
            Severity: Critical
            Found in app/Purifier.php by phan

            Property \App\Purifier::$purifyHtmlInstanceCache has undeclared type \HTMLPurifier
            Open

                private static $purifyHtmlInstanceCache = false;
            Severity: Minor
            Found in app/Purifier.php by phan

            Call to method purify from undeclared class \HTMLPurifier
            Open

                        $value = static::$purifyHtmlInstanceCache->purify($input);
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method __construct from undeclared class \HTMLPurifier
            Open

                        static::$purifyHtmlInstanceCache = new \HTMLPurifier($config);
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method purify from undeclared class \HTMLPurifier
            Open

                    $value = static::$purifyTextParserInstanceCache->purify($input);
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method alnum from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                $value = Validator::alnum($input) ? $input : null;
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method timeInUserFormat from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                $value = Validator::timeInUserFormat($input) ? ($convert ? Fields\Time::formatToDB($input) : $input) : null;
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method __construct from undeclared class \HTMLPurifier
            Open

                        static::$purifyInstanceCache = new \HTMLPurifier($config);
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method email from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                $value = Validator::email($input) ? $input : null;
            Severity: Critical
            Found in app/Purifier.php by phan

            Saw an @param annotation for encode, but it was not found in the param list of function encodeHtml(string $string) : string
            Open

                 * @param bool   $encode
            Severity: Info
            Found in app/Purifier.php by phan

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

                    \App\Log::error('purifySql: ' . $input, 'IllegalValue');
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method standard from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                $value = Validator::standard($input) ? $input : null;
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method dateInUserFormat from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                $value = Validator::dateInUserFormat($input) ? ($convert ? Fields\Date::formatToDB($input) : $input) : null;
            Severity: Critical
            Found in app/Purifier.php by phan

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

                                $dateFormat = User::getCurrentUserModel()->getDetail('date_format');
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method dateInUserFormat from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                    if (!Validator::dateInUserFormat($i)) {
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method sql from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                    if ((empty($input) && $skipEmpty) || Validator::sql($input)) {
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method createDefault from undeclared class \HTMLPurifier_Config
            Open

                    $config = \HTMLPurifier_Config::createDefault();
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method path from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                $value = Validator::path($input) && Validator::path(static::purify($input)) ? $input : null;
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method purify from undeclared class \HTMLPurifier
            Open

                            $value = static::$purifyInstanceCache->purify(static::decodeHtml($input));
            Severity: Critical
            Found in app/Purifier.php by phan

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

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Critical
            Found in app/Purifier.php by phan

            Invalid offset "directives" of array type array{}
            Open

                    foreach ($options['directives'] ?? [] as $key => $value) {
            Severity: Minor
            Found in app/Purifier.php by phan

            Argument 1 (value) is float but \App\Fields\Double::formatToDisplay() takes null|string defined at /code/app/Fields/Double.php:55
            Open

                                if (is_numeric($dbFormat) && Fields\Double::formatToDisplay($dbFormat, false) === Fields\Double::truncateZeros($input)) {
            Severity: Minor
            Found in app/Purifier.php by phan

            Call to method __construct from undeclared class \HTMLPurifier
            Open

                        static::$purifyTextParserInstanceCache = new \HTMLPurifier($config);
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method dateTimeInIsoFormat from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                $value = Validator::dateTimeInIsoFormat($input) ? date('Y-m-d H:i:s', strtotime($input)) : null;
            Severity: Critical
            Found in app/Purifier.php by phan

            Argument 1 (value) is float but \App\Fields\Double::formatToDisplay() takes null|string defined at /code/app/Fields/Double.php:55
            Open

                                if (is_numeric($input) && Fields\Double::formatToDisplay($input, false) === Fields\Double::truncateZeros($rawInput)) {
            Severity: Minor
            Found in app/Purifier.php by phan

            Call to method url from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                $value = Validator::url($input) ? $input : null;
            Severity: Critical
            Found in app/Purifier.php by phan

            Call to method sql from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
            Open

                                $value = $input && Validator::sql($input) ? $input : null;
            Severity: Critical
            Found in app/Purifier.php by phan

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

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Critical
            Found in app/Purifier.php by phan

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

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Critical
            Found in app/Purifier.php by phan

            Return type of getHtmlConfig() is undeclared type \HTMLPurifier_Config
            Open

                public static function getHtmlConfig(array $options = [])
            Severity: Minor
            Found in app/Purifier.php by phan

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

                            \App\Log::error('purifyByType: ' . $input, 'IllegalValue');
            Severity: Critical
            Found in app/Purifier.php by phan

            Avoid excessively long variable names like $removeUnnecessaryCode. Keep variable name length under 20.
            Open

                private static $removeUnnecessaryCode = [
                    'href="javascript:window.history.back();"',
                    'href="javascript:void(0);"',
                ];
            Severity: Minor
            Found in app/Purifier.php by phpmd

            LongVariable

            Since: 0.2

            Detects when a field, formal or local variable is declared with a long name.

            Example

            class Something {
                protected $reallyLongIntName = -3; // VIOLATION - Field
                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                    $otherReallyLongName = -5; // VIOLATION - Local
                    for ($interestingIntIndex = 0; // VIOLATION - For
                         $interestingIntIndex < 10;
                         $interestingIntIndex++ ) {
                    }
                }
            }

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

            Avoid excessively long variable names like $purifyHtmlInstanceCache. Keep variable name length under 20.
            Open

                private static $purifyHtmlInstanceCache = false;
            Severity: Minor
            Found in app/Purifier.php by phpmd

            LongVariable

            Since: 0.2

            Detects when a field, formal or local variable is declared with a long name.

            Example

            class Something {
                protected $reallyLongIntName = -3; // VIOLATION - Field
                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                    $otherReallyLongName = -5; // VIOLATION - Local
                    for ($interestingIntIndex = 0; // VIOLATION - For
                         $interestingIntIndex < 10;
                         $interestingIntIndex++ ) {
                    }
                }
            }

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

            Avoid excessively long variable names like $purifyTextParserInstanceCache. Keep variable name length under 20.
            Open

                private static $purifyTextParserInstanceCache = false;
            Severity: Minor
            Found in app/Purifier.php by phpmd

            LongVariable

            Since: 0.2

            Detects when a field, formal or local variable is declared with a long name.

            Example

            class Something {
                protected $reallyLongIntName = -3; // VIOLATION - Field
                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                    $otherReallyLongName = -5; // VIOLATION - Local
                    for ($interestingIntIndex = 0; // VIOLATION - For
                         $interestingIntIndex < 10;
                         $interestingIntIndex++ ) {
                    }
                }
            }

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

            A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 18 and the first side effect is on line 610.
            Open

            <?php
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                    [$y, $m, $d] = Fields\Date::explode($i, $dateFormat);
            Severity: Minor
            Found in app/Purifier.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

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

                                    [$y, $m, $d] = Fields\Date::explode($i, $dateFormat);
            Severity: Minor
            Found in app/Purifier.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

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

                                    [$y, $m, $d] = Fields\Date::explode($i, $dateFormat);
            Severity: Minor
            Found in app/Purifier.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

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

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

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

                 * Default charset.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                'onclick|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|onmousedown|onmousemove|onmouseout|onmouseover|onbeforepaste|onresizestart|onactivate|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 179 characters
            Open

                'onpropertychange|onfilterchange|onstart|onfinish|onbounce|onrowsinserted|onrowsdelete|onrowexit|onrowenter|ondatasetcomplete|ondatasetchanged|ondataavailable|oncellchange|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param bool   $loop  Purify values in the loop
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $config = \HTMLPurifier_Config::createDefault();
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            static::purifyHtmlEventAttributes($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            if ($loop) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                while ($last !== $value) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param bool   $loop  Purify values in the loop
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if (static::$purifyHtmlInstanceCache) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        if ($loop) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type date in user format. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const BOOL = 'Bool';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @var bool|\HTMLPurifier
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                private static $purifyInstanceCache = false;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                        $config->set('Core.Encoding', static::$defaultCharset);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $config->set('HTML.Allowed', '');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        if (\is_array($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Purify HTML (Cleanup) malicious snippets of code from the input.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                        static::$purifyHtmlInstanceCache = new \HTMLPurifier($config);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param bool   $loop  Purify values in the loop
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const DATE_USER_FORMAT = 'DateInUserFormat';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type integer. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const STANDARD = 'Standard';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type Alnum 2 (A-Za-z0-9\/\+\-). */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type email. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const EMAIL = 'Email';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Cache for Html purify instance.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 184 characters
            Open

                'onclick|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|onmousedown|onmousemove|onmouseout|onmouseover|onbeforepaste|onresizestart|onactivate|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 181 characters
            Open

                'onmouseup|onmousewheel|onscroll|onwheel|oncopy|oncut|onpaste|onload|onselectionchange|onabort|onselectstart|ondragdrop|onmouseleave|onmouseenter|onunload|onresize|onmessage|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    if (static::$purifyInstanceCache) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        return $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    if (!static::$purifyHtmlInstanceCache) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const URL = 'Url';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const ALNUM2 = 'AlnumType2';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const HTML_TEXT_PARSER = 'HtmlTextParser';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            $value = [];
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $last = '';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if (empty($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    // Initialize the instance if it has not yet done
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            $last = '';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $last = $value;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                /** @var string Purify type number. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                 * Purify (Cleanup) malicious snippets of code from the input.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        if (Cache::has('purify', $cacheKey)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                    $value = static::purify($value, false);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            Cache::save('purify', $cacheKey, $value, Cache::SHORT);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        static::purifyHtmlEventAttributes(static::decodeHtml($value));
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    return $value;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                 * @param string $input
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                public const ALNUM = 'Alnum';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                private static $htmlEventAttributes = 'onerror|onblur|onchange|oncontextmenu|onfocus|oninput|oninvalid|onreset|onsearch|onselect|onsubmit|onkeydown|onkeypress|onkeyup|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 174 characters
            Open

                private static $htmlEventAttributes = 'onerror|onblur|onchange|oncontextmenu|onfocus|oninput|oninvalid|onreset|onsearch|onselect|onsubmit|onkeydown|onkeypress|onkeyup|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                'onbeforeupdate|onafterupdate|onerrorupdate|onhelp|onbeforeprint|onafterprint|oncontrolselect|onfocusout|onfocusin|ondeactivate|onbeforeeditfocus|onbeforedeactivate|onbeforeactivate|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    'href="javascript:void(0);"',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                public static function purifyHtml(string $input, $loop = true): string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            while ($last !== $value) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @return string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @var string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public static $defaultCharset;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

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

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

                'onresizeend|onmovestart|onmoveend|onmove|onbeforecopy|onbeforecut|onbeforeunload|onhashchange|onoffline|ononline|onreadystatechange|onstop|onlosecapture';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                            foreach ($input as $k => $v) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $input = str_replace(["\r\n"], "\n", $input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                /** @var string Purify type text. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var bool|\HTMLPurifier Cache for Html template purify instance. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 189 characters
            Open

                'onbeforeupdate|onafterupdate|onerrorupdate|onhelp|onbeforeprint|onafterprint|oncontrolselect|onfocusout|onfocusin|ondeactivate|onbeforeeditfocus|onbeforedeactivate|onbeforeactivate|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param string $input
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if (!static::$purifyInstanceCache) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 131 characters
            Open

                        $config->set('Cache.SerializerPath', ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'cache' . \DIRECTORY_SEPARATOR . 'vtlib');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type url. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type Alnum. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const DIGITS = 'Digits';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                'onpropertychange|onfilterchange|onstart|onfinish|onbounce|onrowsinserted|onrowsdelete|onrowexit|onrowenter|ondatasetcomplete|ondatasetchanged|ondataavailable|oncellchange|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                private static $removeUnnecessaryCode = [
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        return $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

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

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

                public const INTEGER = 'Integer';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type sql. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const SQL = 'Sql';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const HTML = 'Html';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                        // Composite type
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            $input = str_replace(["\r\n"], "\n", $input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    $cacheKey = md5($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $value = static::$purifyHtmlInstanceCache->purify($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                public const TEXT = 'Text';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const NUMBER = 'Number';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type Path. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @var bool|\HTMLPurifier
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @return string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    if (empty($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    if (!\is_array($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $cacheKey = md5($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            return Cache::get('purify', $cacheKey);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $config = static::getHtmlConfig();
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = static::purifyHtml($value, false);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        Cache::save('purifyHtml', $cacheKey, $value, Cache::SHORT);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type html. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                private static $purifyHtmlInstanceCache = false;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                'onmouseup|onmousewheel|onscroll|onwheel|oncopy|oncut|onpaste|onload|onselectionchange|onabort|onselectstart|ondragdrop|onmouseleave|onmouseenter|onunload|onresize|onmessage|' .
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

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

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

                        $config->set('Cache.SerializerPath', ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'cache' . \DIRECTORY_SEPARATOR . 'vtlib');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        } elseif (\is_string($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if (Cache::has('purifyHtml', $cacheKey)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type boolean. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type AlnumExtended. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const ALNUM_EXTENDED = 'AlnumExtended';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                private static $purifyTextParserInstanceCache = false;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 159 characters
            Open

                'onresizeend|onmovestart|onmoveend|onmove|onbeforecopy|onbeforecut|onbeforeunload|onhashchange|onoffline|ononline|onreadystatechange|onstop|onlosecapture';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            $value = static::$purifyInstanceCache->purify(static::decodeHtml($input));
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    return $value;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        return Cache::get('purifyHtml', $cacheKey);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type standard. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Html events attributes.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    'href="javascript:window.history.back();"',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    // Initialize the instance if it has not yet done
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                        $value = static::removeUnnecessaryCode($value);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Purify HTML (Cleanup) malicious snippets of code from text parser.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                        static::$purifyTextParserInstanceCache = new \HTMLPurifier($config);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    static::purifyHtmlEventAttributes($value);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                public static function purifyHtmlEventAttributes(string $value): void
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if (preg_match('#(<[^><]+?[\x00-\x20"\'])([^a-z_\\-]on\\w*|xmlns)(\\s*=\\s*[^><]*)([><]*)#i', $value, $matches)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if (preg_match('#<([^><]+?)javascript:[\w\.]+\(([>]*)#i', $value, $matches)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        'mailto' => true,
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('figure', 'Block', 'Optional: (figcaption, Flow) | (Flow, figcaption) | Flow', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'preload' => 'Enum#auto,metadata,none',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'src' => 'URI',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type Digits. */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public const PATH = 'Path';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Remove unnecessary code list.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $value = $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $config->set('Cache.SerializerPermissions', 0775);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value[$k] = static::purify($v);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                    $last = $value;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                 * @return string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    if (preg_match('#<([^><]+?)(' . static::$htmlEventAttributes . ')(\\s*=\\s*[^><]*)([>]*)#i', $value, $matches)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('Cache.SerializerPath', ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'cache' . \DIRECTORY_SEPARATOR . 'vtlib');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        'ftp' => true,
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            'type' => 'Text',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('audio', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', [
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('source', 'Block', 'Flow', 'Common', [
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'href' => 'URI',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'width' => 'Length',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /** @var string Purify type HTML text parser */
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Cache for purify instance.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                 * @var string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public static function purify($input, $loop = true)
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        static::$purifyInstanceCache = new \HTMLPurifier($config);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param string $input
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $value = $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        $value = preg_replace("/(^[\r\n]*|[\r\n]+)[\\s\t]*[\r\n]+/", "\n", $value);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        throw new Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE|2|' . print_r($matches, true) . "||$value", 406);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                    foreach (self::$removeUnnecessaryCode as $code) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                 * @return \HTMLPurifier_Config
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('link', 'Block', 'Flow', 'Common', [
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'type' => 'Text',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                public static function purifyTextParser($input, $loop = true): string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            'src' => 'URI',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'controls' => 'Bool',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'src' => 'URI',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $cacheKey = md5($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $last = '';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    return $value;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('Cache.SerializerPermissions', 0775);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('CSS.MaxImgLength', null);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        'tel' => true,
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('nav', 'Block', 'Flow', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            'type' => 'Text',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if ($loop) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    Cache::save('purifyTextParser', $cacheKey, $value, Cache::SHORT);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        'http' => true,
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        'nntp' => true,
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'controls' => 'Bool',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('yetiforce', 'Inline', 'Inline', 'Common', [
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('s', 'Inline', 'Inline', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            $last = $value;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                public static function getHtmlConfig(array $options = [])
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('CSS.Proprietary', true);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('article', 'Block', 'Flow', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if (!static::$purifyTextParserInstanceCache) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @return string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        if (false !== stripos($value, $code)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            'height' => 'Length',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if (empty($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        return Cache::get('purifyTextParser', $cacheKey);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $value = static::removeUnnecessaryCode($value);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        throw new Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE|1|' . print_r($matches, true) . "||$value", 406);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 121 characters
            Open

                    if (preg_match('#<([^><]+?)(' . static::$htmlEventAttributes . ')(\\s*=\\s*[^><]*)([>]*)#i', $value, $matches)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        \App\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            $value = str_ireplace($code, '', $value);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('CSS.Trusted', true);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('HTML.SafeEmbed', true);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('footer', 'Block', 'Flow', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            'attachment-id' => 'Length',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                 * Remove unnecessary code.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param string $value
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('HTML.Doctype', 'HTML 4.01 Transitional');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if ($def = $config->getHTMLDefinition(true)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('address', 'Block', 'Flow', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'height' => 'Length',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'poster' => 'URI',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'type' => 'Text',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'crm-id' => 'Length',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        return $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $value = static::$purifyTextParserInstanceCache->purify($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param string $value
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 122 characters
            Open

                    if (preg_match('#(<[^><]+?[\x00-\x20"\'])([^a-z_\\-]on\\w*|xmlns)(\\s*=\\s*[^><]*)([><]*)#i', $value, $matches)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                        $config = static::getHtmlConfig(['directives' => ['HTML.AllowedCommentsRegexp' => '/^(\s+{% |{% )[\s\S]+( %}| %}\s+)$/u']]);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        while ($last !== $value) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            $value = static::purifyTextParser($value, false);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                    $config = \HTMLPurifier_Config::createDefault();
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('Core.Encoding', static::$defaultCharset);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('URI.AllowedSchemes', [
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('hgroup', 'Block', 'Required: h1 | h2 | h3 | h4 | h5 | h6', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'width' => 'Length',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

            Line exceeds 120 characters; contains 127 characters
            Open

                    $config->set('Cache.SerializerPath', ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'cache' . \DIRECTORY_SEPARATOR . 'vtlib');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('Core.RemoveInvalidImg', true);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('HTML.TargetBlank', true);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('aside', 'Block', 'Flow', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'type' => 'Text',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'preload' => 'Enum#auto,metadata,none',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                 * To purify malicious html event attributes.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        throw new Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE|3|' . print_r($matches, true) . "||$value", 406);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public static function removeUnnecessaryCode(string $value): string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Get html config.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        'https' => true,
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $config->set($key, $value);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('header', 'Block', 'Flow', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $value = preg_replace("/(^[\r\n]*|[\r\n]+)[\\s\t]*[\r\n]+/", "\n", $value);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    $config->set('CSS.AllowTricky', true);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('HTML.DefinitionRev', 1);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        $def->addElement('section', 'Block', 'Flow', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('figcaption', 'Inline', 'Flow', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            'rel' => 'Text',
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('var', 'Inline', 'Inline', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('tr', 'width', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if ($uriDef = $config->getURIDefinition()) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                 * @return bool|string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public static function purifySql($input, $skipEmpty = true)
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                            case 2:
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'AlnumType2':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    if (checkdate((int) $m, (int) $d, (int) $y) && is_numeric($y) && is_numeric($m) && is_numeric($d)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                        $v[] = \DateTimeField::convertToDBFormat($i);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            case 'NumberInUserFormat': // number in user format
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = preg_match('/^[\s0-9+\-()]+$/', $input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    if (Cache::has('purifyTextParser', $cacheKey)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 136 characters
            Open

                        $config = static::getHtmlConfig(['directives' => ['HTML.AllowedCommentsRegexp' => '/^(\s+{% |{% )[\s\S]+( %}| %}\s+)$/u']]);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    return $value;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                    $config->set('HTML.SafeIframe', true);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('URI.SafeIframeRegexp', '%^(http:|https:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 135 characters
            Open

                    $config->set('URI.SafeIframeRegexp', '%^(http:|https:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    $config->set('Attr.EnableID', true);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        'news' => true,
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        'data' => true,
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    foreach ($options['directives'] ?? [] as $key => $value) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', [
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

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

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

                 * @param mixed  $input
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param mixed  $convert
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'DateInUserFormat': // date in user format
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'TimeInUserFormat':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = Validator::timeInUserFormat($input) ? ($convert ? Fields\Time::formatToDB($input) : $input) : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                    $value = $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                                $value = Validator::email($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('sub', 'Inline', 'Inline', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('wbr', 'Inline', 'Empty', 'Core');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $uriDef->addFilter(new Extension\HTMLPurifier\Domain(), $config);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    return $config;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param string $type    Data type that is only acceptable
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                $value = Validator::dateTimeInIsoFormat($input) ? date('Y-m-d H:i:s', strtotime($input)) : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('mark', 'Inline', 'Inline', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addElement('del', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('a', 'data-id', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            case 'Standard': // only word
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            case 'Alnum': // word and int
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = preg_match('/^[\sA-Za-z0-9\,\_\.\=\-]+$/', $input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                $value = Validator::dateInUserFormat($input) ? ($convert ? Fields\Date::formatToDB($input) : $input) : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                if ($v) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'Double':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    return '';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('table', 'height', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    if (!Validator::dateInUserFormat($i)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            case 'Bool':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'Number':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'Phone':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('th', 'border', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Purify by data type.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        $value = null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                        $v = [];
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

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

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

                                    $value = $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $value = [];
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'Email':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        switch ($type) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                foreach (explode(',', $input) as $i) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('img', 'data-mce-json', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        // Others
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                $value = preg_match('/^[\sA-Za-z0-9\/\+\-]+$/', $input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'DateTimeInIsoFormat': // date in base format yyyy-mm-dd
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        // TinyMCE
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('img', 'data-mce-src', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                 * Function to return the valid SQl input.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * 1 - only words
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    $value = $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $dbFormat = Fields\Double::formatToDb($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                if (false !== ($input = filter_var($input, FILTER_VALIDATE_INT))) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('tr', 'height', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    \App\Log::error('purifySql: ' . $input, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = Validator::standard($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 128 characters
            Open

                                $value = Validator::dateInUserFormat($input) ? ($convert ? Fields\Date::formatToDB($input) : $input) : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                    $value = $v;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 141 characters
            Open

                                if (is_numeric($dbFormat) && Fields\Double::formatToDisplay($dbFormat, false) === Fields\Double::truncateZeros($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                 * Standard - only words
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

            Line exceeds 120 characters; contains 128 characters
            Open

                                $value = Validator::timeInUserFormat($input) ? ($convert ? Fields\Time::formatToDB($input) : $input) : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'DateRangeUserFormat': // date range user format
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $v = [];
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 124 characters
            Open

                                    if (checkdate((int) $m, (int) $d, (int) $y) && is_numeric($y) && is_numeric($m) && is_numeric($d)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                        $def->addAttribute('td', 'border', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param bool   $skipEmpty Skip the check if string is empty
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

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

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

                        foreach ($input as $k => $v) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            $value[$k] = static::purifyByType($v, $type);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                if (is_numeric($input) && Fields\Double::formatToDisplay($input, false) === Fields\Double::truncateZeros($rawInput)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'Html':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'Integer': // Integer
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('a', 'data-module', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @param string $input
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        return $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $input = Fields\Double::formatToDb($rawInput = $input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                $value = self::purifyHtml($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('iframe', 'allowfullscreen', 'Bool');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    return '';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $dateFormat = User::getCurrentUserModel()->getDetail('date_format');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    [$y, $m, $d] = Fields\Date::explode($i, $dateFormat);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    $value = $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        $def->addElement('ins', 'Block', 'Flow', 'Common', ['cite' => 'URI', 'datetime' => 'CDATA']);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                        $def->addAttribute('tr', 'border', 'Text');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    if ((empty($input) && $skipEmpty) || Validator::sql($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                 * Type list:
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public static function purifyByType($input, $type, $convert = false)
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    if (\is_array($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                $value = self::bool($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Line exceeds 120 characters; contains 138 characters
            Open

                                if (is_numeric($input) && Fields\Double::formatToDisplay($input, false) === Fields\Double::truncateZeros($rawInput)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                if (is_numeric($dbFormat) && Fields\Double::formatToDisplay($dbFormat, false) === Fields\Double::truncateZeros($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        $def->addElement('sup', 'Inline', 'Inline', 'Common');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $input, 406);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Alnum - word and int
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * 2 - word and int
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            case 1:
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = Validator::alnum($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'AlnumExtended':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                if (false !== ($input = filter_var($input, FILTER_VALIDATE_FLOAT))) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

            Line exceeds 120 characters; contains 124 characters
            Open

                                if (is_numeric($input) && (int) $input >= 0 && (int) $input <= 3000 && 4 === \strlen((string) $input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'Url':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'ClassName':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'Text':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    if (Validator::{$type}($input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                                    $value = (string) $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $input = ltrim(rtrim(trim($input), '>'), '<');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                if (method_exists('App\Validator', $type)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    return $value;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * Function to convert the given string to html.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                                        $value = $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                public static function bool($value)
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                public static function encodeHtml($string)
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                $value = Validator::url($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = self::purify($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @return bool|null
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

            Line exceeds 120 characters; contains 133 characters
            Open

                                if (false !== ($input = filter_var($input, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^[0-9]+$/']]))) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                if (is_numeric($input) && (int) $input >= 0 && (int) $input <= 3000 && 4 === \strlen((string) $input)) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case 'Version':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

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

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

                            default:
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                            \App\Log::error('purifyByType: ' . $input, 'IllegalValue');
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @return string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                                $value = $input && Validator::sql($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = self::purifyTextParser($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                        if (null === $value) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $input, 406);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                 * @param string $string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                    return '';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case self::SQL:
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    $value = self::purify($input);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                    return $string !== null ? htmlspecialchars($string, ENT_QUOTES, static::$defaultCharset) : '';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    return $string !== null ? html_entity_decode($string, ENT_QUOTES, static::$defaultCharset) : '';
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = Validator::path($input) && Validator::path(static::purify($input)) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = preg_match('/^[a-z\\\_]+$/i', $input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                            case self::HTML_TEXT_PARSER:
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                public static function decodeHtml($string)
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                if (false !== ($input = filter_var($input, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^[0-9]+$/']]))) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = preg_match('/^(#[0-9a-fA-F]{6})$/', $input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                    return filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                 * @return string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

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

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

                            case 'MailId':
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                 * @param string $string
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

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

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

                                    $value = $input;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                                $value = preg_match('/^[\.0-9]+$/', $input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

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

                /**
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            case self::PATH:
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                if (!$input) {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $value = $input === strip_tags($input) ? $input : null;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param bool   $encode
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function to decode html.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            case 'Color': // colors
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                break;
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int|string $value
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            case 'Digits': // Digits - eg. 000523
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                }
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            case 'Year': // 2018 etc
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function to convert the given value to bool.
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/Purifier.php by phpcodesniffer

            There are no issues that match your filters.

            Category
            Status