vakata/certificate

View on GitHub
src/Certificate.php

Summary

Maintainability
F
2 wks
Test Coverage
F
25%

File Certificate.php has 884 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace vakata\certificate;

use vakata\asn1\ASN1;
Severity: Major
Found in src/Certificate.php - About 2 days to fix

    Function parseLegacyCertificate has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function parseLegacyCertificate(array $cert)
        {
            $iss = null;
            $pro = null;
            $nat = null;
    Severity: Minor
    Found in src/Certificate.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

    Method parseLegacyCertificate has 282 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function parseLegacyCertificate(array $cert)
        {
            $iss = null;
            $pro = null;
            $nat = null;
    Severity: Major
    Found in src/Certificate.php - About 1 day to fix

      Function isRevokedOCSP has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
      Open

          public function isRevokedOCSP() : bool
          {
              $ocsp = $this->getOCSPPoints();
              if (count($ocsp)) {
                  if ($this->isSelfSigned()) {
      Severity: Minor
      Found in src/Certificate.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

      Certificate has 44 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Certificate
      {
          protected $cert;
          protected $data;
          protected $sign;
      Severity: Minor
      Found in src/Certificate.php - About 6 hrs to fix

        Function parseCertificate has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function parseCertificate(string $cert) : array
            {
                try {
                    $orig = Parser::fromString($cert)->toArray();
                    $data = $orig['tbsCertificate'];
        Severity: Minor
        Found in src/Certificate.php - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function getSubjectData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getSubjectData() : array
            {
                $original = $this->cert['extensions'][ASN1::TextToOID('subjectAltName')] ?? [];
                while (is_array($original) && isset($original[0]) && is_array($original[0]) && isset($original[0][0]) && is_array($original[0][0])) {
                    $original = $original[0];
        Severity: Minor
        Found in src/Certificate.php - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

        class Certificate
        {
            protected $cert;
            protected $data;
            protected $sign;
        Severity: Minor
        Found in src/Certificate.php by phpmd

        Method isRevokedOCSP has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function isRevokedOCSP() : bool
            {
                $ocsp = $this->getOCSPPoints();
                if (count($ocsp)) {
                    if ($this->isSelfSigned()) {
        Severity: Major
        Found in src/Certificate.php - About 3 hrs to fix

          Method parseCertificate has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function parseCertificate(string $cert) : array
              {
                  try {
                      $orig = Parser::fromString($cert)->toArray();
                      $data = $orig['tbsCertificate'];
          Severity: Major
          Found in src/Certificate.php - About 2 hrs to fix

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

                public function isRevokedCRL(array $ca = [], int $time = null) : bool
                {
                    if ($time === null) {
                        $time = time();
                    }
            Severity: Minor
            Found in src/Certificate.php - About 1 hr to fix

            Cognitive Complexity

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

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

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

            Further reading

            Method getSubjectData has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getSubjectData() : array
                {
                    $original = $this->cert['extensions'][ASN1::TextToOID('subjectAltName')] ?? [];
                    while (is_array($original) && isset($original[0]) && is_array($original[0]) && isset($original[0][0]) && is_array($original[0][0])) {
                        $original = $original[0];
            Severity: Minor
            Found in src/Certificate.php - About 1 hr to fix

              Method isRevokedCRL has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function isRevokedCRL(array $ca = [], int $time = null) : bool
                  {
                      if ($time === null) {
                          $time = time();
                      }
              Severity: Minor
              Found in src/Certificate.php - About 1 hr to fix

                Method getPublicKey has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getPublicKey(bool $pemEncoded = true) : string
                    {
                        $map = [
                            'tag' => ASN1::TYPE_SEQUENCE,
                            'children' => [
                Severity: Minor
                Found in src/Certificate.php - About 1 hr to fix

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

                      public function getKeyUsage() : array
                      {
                          $kusage = $this->cert['extensions'][ASN1::TextToOID('keyUsage')] ?? null;
                          if (!isset($kusage)) {
                              return [];
                  Severity: Minor
                  Found in src/Certificate.php - About 1 hr to fix

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

                        public function getCPSPolicies() : array
                        {
                            $policies = [];
                            $temp = $this->cert['extensions'][ASN1::TextToOID('certificatePolicies')] ?? [];
                            foreach ($temp as $policy) {
                    Severity: Minor
                    Found in src/Certificate.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 getCRLPoints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getCRLPoints(bool $httpOnly = true) : array
                        {
                            $points = $this->cert['extensions'][ASN1::TextToOID('cRLDistributionPoints')] ?? [];
                            $result = [];
                            foreach ($points as $point) {
                    Severity: Minor
                    Found in src/Certificate.php - About 35 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                        public function getOCSPPoints() : array
                        {
                            $urls = [];
                            $ocsp = $this->cert['extensions'][ASN1::TextToOID('authorityInfoAccess')] ?? [];
                            foreach ($ocsp as $loc) {
                    Severity: Minor
                    Found in src/Certificate.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

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

                        public function getKeyUsage() : array
                        {
                            $kusage = $this->cert['extensions'][ASN1::TextToOID('keyUsage')] ?? null;
                            if (!isset($kusage)) {
                                return [];
                    Severity: Minor
                    Found in src/Certificate.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 class Certificate has 1123 lines of code. Current threshold is 1000. Avoid really long classes.
                    Open

                    class Certificate
                    {
                        protected $cert;
                        protected $data;
                        protected $sign;
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

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

                        protected function parseLegacyCertificate(array $cert)
                        {
                            $iss = null;
                            $pro = null;
                            $nat = null;
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

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

                        public function getSubjectData() : array
                        {
                            $original = $this->cert['extensions'][ASN1::TextToOID('subjectAltName')] ?? [];
                            while (is_array($original) && isset($original[0]) && is_array($original[0]) && isset($original[0][0]) && is_array($original[0][0])) {
                                $original = $original[0];
                    Severity: Minor
                    Found in src/Certificate.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 isRevokedOCSP() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
                    Open

                        public function isRevokedOCSP() : bool
                        {
                            $ocsp = $this->getOCSPPoints();
                            if (count($ocsp)) {
                                if ($this->isSelfSigned()) {
                    Severity: Minor
                    Found in src/Certificate.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 parseCertificate() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
                    Open

                        protected function parseCertificate(string $cert) : array
                        {
                            try {
                                $orig = Parser::fromString($cert)->toArray();
                                $data = $orig['tbsCertificate'];
                    Severity: Minor
                    Found in src/Certificate.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 parseLegacyCertificate() has a Cyclomatic Complexity of 69. The configured cyclomatic complexity threshold is 10.
                    Open

                        protected function parseLegacyCertificate(array $cert)
                        {
                            $iss = null;
                            $pro = null;
                            $nat = null;
                    Severity: Minor
                    Found in src/Certificate.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 class Certificate has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
                    Open

                    class Certificate
                    {
                        protected $cert;
                        protected $data;
                        protected $sign;
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

                    CouplingBetweenObjects

                    Since: 1.1.0

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

                    Example

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

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

                    Remove error control operator '@' on line 1042.
                    Open

                        public function isRevokedCRL(array $ca = [], int $time = null) : bool
                        {
                            if ($time === null) {
                                $time = time();
                            }
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

                    ErrorControlOperator

                    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                    Example

                    function foo($filePath) {
                        $file = @fopen($filPath); // hides exceptions
                        $key = @$array[$notExistingKey]; // assigns null to $key
                    }

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

                    Remove error control operator '@' on line 972.
                    Open

                        public function isRevokedOCSP() : bool
                        {
                            $ocsp = $this->getOCSPPoints();
                            if (count($ocsp)) {
                                if ($this->isSelfSigned()) {
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

                    ErrorControlOperator

                    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                    Example

                    function foo($filePath) {
                        $file = @fopen($filPath); // hides exceptions
                        $key = @$array[$notExistingKey]; // assigns null to $key
                    }

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

                    Missing class import via use statement (line '735', column '17').
                    Open

                                new \RecursiveIteratorIterator(
                    Severity: Minor
                    Found in src/Certificate.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 '736', column '21').
                    Open

                                    new \RecursiveArrayIterator($this->cert['extensions'][ASN1::TextToOID('certificatePolicies')] ?? [])
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

                    MissingImport

                    Since: 2.7.0

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

                    Example

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

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

                    Avoid using static access to class '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                    $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                            [ASN1::TextToOID('organizationalUnit')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                    $compacted[ASN1::TextToOID('countryOfCitizenship')] ?? 'BG',
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getSubjectData'.
                    Open

                            $original = $this->cert['extensions'][ASN1::TextToOID('subjectAltName')] ?? [];
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('countryName')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getCPSPolicies'.
                    Open

                                    if (strtolower($policyId[0]) === ASN1::TextToOID('cps')) {
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getPolicies'.
                    Open

                            foreach (($this->cert['extensions'][ASN1::TextToOID('certificatePolicies')] ?? []) as $policy) {
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getSubjectKeyIdentifier'.
                    Open

                            return $this->cert['extensions'][ASN1::TextToOID('subjectKeyIdentifier')] ?? null;
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getExtendedKeyUsage'.
                    Open

                            foreach (($this->cert['extensions'][ASN1::TextToOID('extKeyUsage')] ?? []) as $usage) {
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseNaturalPerson'.
                    Open

                                    $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 'vakata\certificate\Signature' in method 'isSignatureValid'.
                    Open

                                return Signature::verify(
                                    $this->sign['subject'],
                                    substr($this->sign['signature'], 1),
                                    $this->getPublicKey(),
                                    $this->sign['algorithm']['algorithm']
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegalPerson'.
                    Open

                            $legal = $cert['subject'][ASN1::TextToOID('organizationIdentifier')] ?? null;
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('organization')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                            [ASN1::TextToOID('organizationalUnit'), ASN1::TextToOID('title')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                            [ASN1::TextToOID('stateOrProvinceName'), ASN1::TextToOID('organizationalUnit')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getKeyUsage'.
                    Open

                            $kusage = $this->cert['extensions'][ASN1::TextToOID('keyUsage')] ?? null;
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                            [ASN1::TextToOID('organizationalUnit'), ASN1::TextToOID('title')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getExtendedKeyUsage'.
                    Open

                                $usages[$usage] = ASN1::OIDtoText($usage);
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('countryName')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getIssuerData'.
                    Open

                                $result[ASN1::OIDtoText($k)] = $v;
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\structures\OCSPRequest' in method 'isRevokedOCSP'.
                    Open

                                $ocspRequest = OCSPRequest::generate('sha1', $nameHash, $keyHash, $this->getSerialNumber());
                    Severity: Minor
                    Found in src/Certificate.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 'vakata\certificate\Signature' in method 'isRevokedOCSP'.
                    Open

                                                if (!Signature::verify(
                                                    $ocspData->subject(),
                                                    substr($ocspResponse['responseBytes']['response']['signature'], 1),
                                                    $validateAgainst->getPublicKey(),
                                                    ASN1::OIDtoText($ocspResponse['responseBytes']['response']['signatureAlgorithm']['algorithm'])
                    Severity: Minor
                    Found in src/Certificate.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 'vakata\certificate\Signature' in method 'isSignatureValid'.
                    Open

                            return Signature::verify(
                                $this->sign['subject'],
                                substr($this->sign['signature'], 1),
                                $this->caCertificate->getPublicKey(),
                                $this->sign['algorithm']['algorithm']
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('countryName')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getCertificatePolicies'.
                    Open

                                    new \RecursiveArrayIterator($this->cert['extensions'][ASN1::TextToOID('certificatePolicies')] ?? [])
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('organization')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('organization')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getSubjectData'.
                    Open

                                $result[ASN1::OIDtoText($k)] = $v;
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'isRevokedOCSP'.
                    Open

                                                    ASN1::OIDtoText($ocspResponse['responseBytes']['response']['signatureAlgorithm']['algorithm'])
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                            [ASN1::TextToOID('stateOrProvinceName'), ASN1::TextToOID('organizationalUnit')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                    $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                            [ASN1::TextToOID('organizationalUnit'), ASN1::TextToOID('title')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                    $cert['subject'][ASN1::TextToOID('organization')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                    if (in_array($pro, ['2.5.2', '2.5.3', '2.1.2', '2.1.3']) && isset($cert['subject'][ASN1::TextToOID('organizationalUnit')])) {
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegalPerson'.
                    Open

                                    $cert['subject'][ASN1::TextToOID('organization')] ?? '',
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getCPSPolicies'.
                    Open

                            $temp = $this->cert['extensions'][ASN1::TextToOID('certificatePolicies')] ?? [];
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getOCSPPoints'.
                    Open

                            $ocsp = $this->cert['extensions'][ASN1::TextToOID('authorityInfoAccess')] ?? [];
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getOCSPPoints'.
                    Open

                                if (isset($loc[0]) && isset($loc[1]) && strtolower($loc[0]) === ASN1::TextToOID('ocsp')) {
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseCertificate'.
                    Open

                            $oid = ASN1::TextToOID('authorityKeyIdentifier');
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                    if (in_array($pro, ['1.1.1.5', '1.2.1.3', '1.1.1.1', '1.2.1.2']) && isset($cert['subject'][ASN1::TextToOID('stateOrProvinceName')])) {
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('countryName')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'base256toHex'.
                    Open

                            $num = ASN1::fromBase256($inp);
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseNaturalPerson'.
                    Open

                            $natural = $cert['subject'][ASN1::TextToOID('serialNumber')] ?? null;
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                        $ou = $cert['subject'][ASN1::TextToOID('organizationalUnit')];
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getQcStatements'.
                    Open

                            foreach (($this->cert['extensions'][ASN1::TextToOID('qcStatements')] ?? []) as $statement) {
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getCRLPoints'.
                    Open

                            $points = $this->cert['extensions'][ASN1::TextToOID('cRLDistributionPoints')] ?? [];
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseNaturalPerson'.
                    Open

                                    $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                            [ASN1::TextToOID('stateOrProvinceName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('countryName')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                        $original = $this->cert['extensions'][ASN1::TextToOID('subjectAltName')] ?? [];
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseCertificate'.
                    Open

                            $oid = ASN1::TextToOID('subjectKeyIdentifier');
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'getAuthorityKeyIdentifier'.
                    Open

                            return $this->cert['extensions'][ASN1::TextToOID('authorityKeyIdentifier')] ?? null;
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\structures\OCSPResponse' in method 'isRevokedOCSP'.
                    Open

                                            $ocspData = OCSPResponse::fromString($response);
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                    if (in_array($pro, ['1.1.1', '2.5.1', '2.1.1', '2.5.2', '2.5.3', '2.1.2', '2.1.3']) && isset($cert['subject'][ASN1::TextToOID('userid')])) {
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('emailAddress')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                        $egn = explode('EGN', $cert['subject'][ASN1::TextToOID('userid')], 2);
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('organization')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\Encoder' in method 'getPublicKey'.
                    Open

                            $pkey = Encoder::encode($this->cert['SubjectPublicKeyInfo'], $map);
                    Severity: Minor
                    Found in src/Certificate.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 'vakata\certificate\CRL' in method 'isRevokedCRL'.
                    Open

                                    $data = CRL::fromString($data);
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('commonName')],
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                                $cert['subject'][ASN1::TextToOID('countryName')] ?? null,
                    Severity: Minor
                    Found in src/Certificate.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 '\vakata\asn1\ASN1' in method 'parseLegacyCertificate'.
                    Open

                                            [ASN1::TextToOID('organizationalUnit'), ASN1::TextToOID('title')],
                    Severity: Minor
                    Found in src/Certificate.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 unused local variables such as '$keyID'.
                    Open

                                    $keyID = $data->getAuthorityKeyIdentifier();
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

                    UnusedLocalVariable

                    Since: 0.2

                    Detects when a local variable is declared and/or assigned, but not used.

                    Example

                    class Foo {
                        public function doSomething()
                        {
                            $i = 5; // Unused
                        }
                    }

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

                    Avoid using empty try-catch blocks in isRevokedOCSP.
                    Open

                                        } catch (\Exception $ignore) {
                                        }
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

                    EmptyCatchBlock

                    Since: 2.7.0

                    Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

                    Example

                    class Foo {
                    
                      public function bar()
                      {
                          try {
                              // ...
                          } catch (Exception $e) {} // empty catch block
                      }
                    }

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

                    Avoid using vakata\certificate\count() function in while loops.
                    Open

                                while (is_array($loc) && count($loc) === 1 && isset($loc[0])) {
                                    $loc = $loc[0];
                                }
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

                    CountInLoopExpression

                    Since: 2.7.0

                    Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

                    Example

                    class Foo {
                    
                      public function bar()
                      {
                        $array = array();
                    
                        for ($i = 0; count($array); $i++) {
                          // ...
                        }
                      }
                    }

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

                    Avoid using vakata\certificate\count() function in while loops.
                    Open

                                            while (is_array($item[1]) && count($item[1]) === 1) {
                                                $item[1] = array_values($item[1])[0];
                                            }
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

                    CountInLoopExpression

                    Since: 2.7.0

                    Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

                    Example

                    class Foo {
                    
                      public function bar()
                      {
                        $array = array();
                    
                        for ($i = 0; count($array); $i++) {
                          // ...
                        }
                      }
                    }

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

                    Avoid using vakata\certificate\count() function in while loops.
                    Open

                                        while (is_array($item) && count($item) === 1) {
                                            $item = array_values($item)[0];
                                        }
                    Severity: Minor
                    Found in src/Certificate.php by phpmd

                    CountInLoopExpression

                    Since: 2.7.0

                    Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

                    Example

                    class Foo {
                    
                      public function bar()
                      {
                        $array = array();
                    
                        for ($i = 0; count($array); $i++) {
                          // ...
                        }
                      }
                    }

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

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

                                    } elseif (in_array($pro, ['1.1.1.3', '1.1.1.4', '1.1.1.6'])) {
                                        $parsed = $parseSubject(
                                            $cert['subject'],
                                            [ASN1::TextToOID('organizationalUnit'), ASN1::TextToOID('title')],
                                            ['EGN'=>'egn', 'PID'=>'pid', 'B'=>'bulstat']
                    Severity: Major
                    Found in src/Certificate.php and 1 other location - About 1 day to fix
                    src/Certificate.php on lines 353..387

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 331.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                    if ($pro === '1.5.1.1') {
                                        $parsed = $parseSubject(
                                            $cert['subject'],
                                            [ASN1::TextToOID('stateOrProvinceName'), ASN1::TextToOID('organizationalUnit')],
                                            ['EGN'=>'egn', 'PID'=>'pid', 'BULSTAT'=>'bulstat']
                    Severity: Major
                    Found in src/Certificate.php and 1 other location - About 1 day to fix
                    src/Certificate.php on lines 488..522

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 331.

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

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

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

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

                    Refactorings

                    Further Reading

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

                            foreach ($data['subject'] as $item) {
                                foreach ($item as $subitem) {
                                    if (isset($temp[$subitem['key']])) {
                                        if (!is_array($temp[$subitem['key']])) {
                                            $temp[$subitem['key']] = [ $temp[$subitem['key']] ];
                    Severity: Major
                    Found in src/Certificate.php and 1 other location - About 2 hrs to fix
                    src/Certificate.php on lines 162..173

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 123.

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

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

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

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

                    Refactorings

                    Further Reading

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

                            foreach ($data['issuer'] as $item) {
                                foreach ($item as $subitem) {
                                    if (isset($temp[$subitem['key']])) {
                                        if (!is_array($temp[$subitem['key']])) {
                                            $temp[$subitem['key']] = [ $temp[$subitem['key']] ];
                    Severity: Major
                    Found in src/Certificate.php and 1 other location - About 2 hrs to fix
                    src/Certificate.php on lines 148..159

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 123.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        protected static function base256toHex($inp) : string
                        {
                            $num = ASN1::fromBase256($inp);
                            $hex = '';
                            for ($i = strlen($num) - 4; $i >= 0; $i-=4) {
                    Severity: Major
                    Found in src/Certificate.php and 1 other location - About 1 hr to fix
                    src/CRL.php on lines 13..21

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 104.

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

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

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

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

                    Refactorings

                    Further Reading

                    Opening brace should be on the same line as the declaration
                    Open

                            {
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Space found before closing bracket of FOREACH loop
                    Open

                            foreach (
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Space found after opening bracket of FOREACH loop
                    Open

                            foreach (
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Line exceeds 120 characters; contains 143 characters
                    Open

                                                $status = $ocspResponse['responseBytes']['response']['tbsResponseData']['responses'][0]['certStatus'] ?? 'unknown';
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Line exceeds 120 characters; contains 141 characters
                    Open

                                    if (in_array($pro, ['2.5.2', '2.5.3', '2.1.2', '2.1.3']) && isset($cert['subject'][ASN1::TextToOID('organizationalUnit')])) {
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Line exceeds 120 characters; contains 125 characters
                    Open

                                                    "Content-Type: application/ocsp-request\r\nContent-Length: " . strlen($ocspRequest) . "\r\n",
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Line exceeds 120 characters; contains 156 characters
                    Open

                                    if (in_array($pro, ['1.1.1', '2.5.1', '2.1.1', '2.5.2', '2.5.3', '2.1.2', '2.1.3']) && isset($cert['subject'][ASN1::TextToOID('userid')])) {
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Line exceeds 120 characters; contains 150 characters
                    Open

                                    if (in_array($pro, ['1.1.1.5', '1.2.1.3', '1.1.1.1', '1.2.1.2']) && isset($cert['subject'][ASN1::TextToOID('stateOrProvinceName')])) {
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Line exceeds 120 characters; contains 126 characters
                    Open

                                                    ASN1::OIDtoText($ocspResponse['responseBytes']['response']['signatureAlgorithm']['algorithm'])
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Line exceeds 120 characters; contains 153 characters
                    Open

                                        while (is_array($original) && isset($original[0]) && is_array($original[0]) && isset($original[0][0]) && is_array($original[0][0])) {
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Line exceeds 120 characters; contains 141 characters
                    Open

                            while (is_array($original) && isset($original[0]) && is_array($original[0]) && isset($original[0][0]) && is_array($original[0][0])) {
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Whitespace found at end of line
                    Open

                         * 
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Whitespace found at end of line
                    Open

                            return '' . 
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Expected 0 spaces after opening bracket; newline found
                    Open

                            foreach (
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Closing parenthesis of a multi-line function call must be on a line by itself
                    Open

                                    1), true));
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Whitespace found at end of line
                    Open

                         * 
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    Whitespace found at end of line
                    Open

                         * 
                    Severity: Minor
                    Found in src/Certificate.php by phpcodesniffer

                    There are no issues that match your filters.

                    Category
                    Status