GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( da62d3...8abb02 )
by Joni
02:44
created
lib/X509/Certificate/Extension/NameConstraints/GeneralSubtree.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -18,91 +18,91 @@
 block discarded – undo
18 18
  */
19 19
 class GeneralSubtree
20 20
 {
21
-    /**
22
-     * Constraint.
23
-     *
24
-     * @var GeneralName
25
-     */
26
-    protected $_base;
21
+	/**
22
+	 * Constraint.
23
+	 *
24
+	 * @var GeneralName
25
+	 */
26
+	protected $_base;
27 27
     
28
-    /**
29
-     * Not used, must be zero.
30
-     *
31
-     * @var int $_min
32
-     */
33
-    protected $_min;
28
+	/**
29
+	 * Not used, must be zero.
30
+	 *
31
+	 * @var int $_min
32
+	 */
33
+	protected $_min;
34 34
     
35
-    /**
36
-     * Not used, must be null.
37
-     *
38
-     * @var int|null $_max
39
-     */
40
-    protected $_max;
35
+	/**
36
+	 * Not used, must be null.
37
+	 *
38
+	 * @var int|null $_max
39
+	 */
40
+	protected $_max;
41 41
     
42
-    /**
43
-     * Constructor.
44
-     *
45
-     * @param GeneralName $base
46
-     * @param int $min
47
-     * @param int|null $max
48
-     */
49
-    public function __construct(GeneralName $base, int $min = 0, $max = null)
50
-    {
51
-        $this->_base = $base;
52
-        $this->_min = $min;
53
-        $this->_max = $max;
54
-    }
42
+	/**
43
+	 * Constructor.
44
+	 *
45
+	 * @param GeneralName $base
46
+	 * @param int $min
47
+	 * @param int|null $max
48
+	 */
49
+	public function __construct(GeneralName $base, int $min = 0, $max = null)
50
+	{
51
+		$this->_base = $base;
52
+		$this->_min = $min;
53
+		$this->_max = $max;
54
+	}
55 55
     
56
-    /**
57
-     * Initialize from ASN.1.
58
-     *
59
-     * @param Sequence $seq
60
-     * @return self
61
-     */
62
-    public static function fromASN1(Sequence $seq): self
63
-    {
64
-        $base = GeneralName::fromASN1($seq->at(0)->asTagged());
65
-        $min = 0;
66
-        $max = null;
67
-        if ($seq->hasTagged(0)) {
68
-            $min = $seq->getTagged(0)
69
-                ->asImplicit(Element::TYPE_INTEGER)
70
-                ->asInteger()
71
-                ->intNumber();
72
-        }
73
-        if ($seq->hasTagged(1)) {
74
-            $max = $seq->getTagged(1)
75
-                ->asImplicit(Element::TYPE_INTEGER)
76
-                ->asInteger()
77
-                ->intNumber();
78
-        }
79
-        return new self($base, $min, $max);
80
-    }
56
+	/**
57
+	 * Initialize from ASN.1.
58
+	 *
59
+	 * @param Sequence $seq
60
+	 * @return self
61
+	 */
62
+	public static function fromASN1(Sequence $seq): self
63
+	{
64
+		$base = GeneralName::fromASN1($seq->at(0)->asTagged());
65
+		$min = 0;
66
+		$max = null;
67
+		if ($seq->hasTagged(0)) {
68
+			$min = $seq->getTagged(0)
69
+				->asImplicit(Element::TYPE_INTEGER)
70
+				->asInteger()
71
+				->intNumber();
72
+		}
73
+		if ($seq->hasTagged(1)) {
74
+			$max = $seq->getTagged(1)
75
+				->asImplicit(Element::TYPE_INTEGER)
76
+				->asInteger()
77
+				->intNumber();
78
+		}
79
+		return new self($base, $min, $max);
80
+	}
81 81
     
82
-    /**
83
-     * Get constraint.
84
-     *
85
-     * @return GeneralName
86
-     */
87
-    public function base(): GeneralName
88
-    {
89
-        return $this->_base;
90
-    }
82
+	/**
83
+	 * Get constraint.
84
+	 *
85
+	 * @return GeneralName
86
+	 */
87
+	public function base(): GeneralName
88
+	{
89
+		return $this->_base;
90
+	}
91 91
     
92
-    /**
93
-     * Generate ASN.1 structure.
94
-     *
95
-     * @return Sequence
96
-     */
97
-    public function toASN1(): Sequence
98
-    {
99
-        $elements = array($this->_base->toASN1());
100
-        if (isset($this->_min) && $this->_min != 0) {
101
-            $elements[] = new ImplicitlyTaggedType(0, new Integer($this->_min));
102
-        }
103
-        if (isset($this->_max)) {
104
-            $elements[] = new ImplicitlyTaggedType(1, new Integer($this->_max));
105
-        }
106
-        return new Sequence(...$elements);
107
-    }
92
+	/**
93
+	 * Generate ASN.1 structure.
94
+	 *
95
+	 * @return Sequence
96
+	 */
97
+	public function toASN1(): Sequence
98
+	{
99
+		$elements = array($this->_base->toASN1());
100
+		if (isset($this->_min) && $this->_min != 0) {
101
+			$elements[] = new ImplicitlyTaggedType(0, new Integer($this->_min));
102
+		}
103
+		if (isset($this->_max)) {
104
+			$elements[] = new ImplicitlyTaggedType(1, new Integer($this->_max));
105
+		}
106
+		return new Sequence(...$elements);
107
+	}
108 108
 }
Please login to merge, or discard this patch.
lib/X509/Certificate/Extension/UnknownExtension.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -11,32 +11,32 @@
 block discarded – undo
11 11
  */
12 12
 class UnknownExtension extends Extension
13 13
 {
14
-    /**
15
-     * Extension value.
16
-     *
17
-     * @var Element $_element
18
-     */
19
-    protected $_element;
14
+	/**
15
+	 * Extension value.
16
+	 *
17
+	 * @var Element $_element
18
+	 */
19
+	protected $_element;
20 20
     
21
-    /**
22
-     * Constructor.
23
-     *
24
-     * @param string $oid
25
-     * @param bool $critical
26
-     * @param Element $data
27
-     */
28
-    public function __construct(string $oid, bool $critical, Element $data)
29
-    {
30
-        parent::__construct($oid, $critical);
31
-        $this->_element = $data;
32
-    }
21
+	/**
22
+	 * Constructor.
23
+	 *
24
+	 * @param string $oid
25
+	 * @param bool $critical
26
+	 * @param Element $data
27
+	 */
28
+	public function __construct(string $oid, bool $critical, Element $data)
29
+	{
30
+		parent::__construct($oid, $critical);
31
+		$this->_element = $data;
32
+	}
33 33
     
34
-    /**
35
-     *
36
-     * {@inheritdoc}
37
-     */
38
-    protected function _valueASN1(): Element
39
-    {
40
-        return $this->_element;
41
-    }
34
+	/**
35
+	 *
36
+	 * {@inheritdoc}
37
+	 */
38
+	protected function _valueASN1(): Element
39
+	{
40
+		return $this->_element;
41
+	}
42 42
 }
Please login to merge, or discard this patch.
lib/X509/Certificate/Extension/InhibitAnyPolicyExtension.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -13,51 +13,51 @@
 block discarded – undo
13 13
  */
14 14
 class InhibitAnyPolicyExtension extends Extension
15 15
 {
16
-    /**
17
-     *
18
-     * @var int $_skipCerts
19
-     */
20
-    protected $_skipCerts;
16
+	/**
17
+	 *
18
+	 * @var int $_skipCerts
19
+	 */
20
+	protected $_skipCerts;
21 21
     
22
-    /**
23
-     * Constructor.
24
-     *
25
-     * @param bool $critical
26
-     * @param int $skip_certs
27
-     */
28
-    public function __construct(bool $critical, int $skip_certs)
29
-    {
30
-        parent::__construct(self::OID_INHIBIT_ANY_POLICY, $critical);
31
-        $this->_skipCerts = $skip_certs;
32
-    }
22
+	/**
23
+	 * Constructor.
24
+	 *
25
+	 * @param bool $critical
26
+	 * @param int $skip_certs
27
+	 */
28
+	public function __construct(bool $critical, int $skip_certs)
29
+	{
30
+		parent::__construct(self::OID_INHIBIT_ANY_POLICY, $critical);
31
+		$this->_skipCerts = $skip_certs;
32
+	}
33 33
     
34
-    /**
35
-     *
36
-     * {@inheritdoc}
37
-     * @return self
38
-     */
39
-    protected static function _fromDER(string $data, bool $critical): self
40
-    {
41
-        return new self($critical, Integer::fromDER($data)->intNumber());
42
-    }
34
+	/**
35
+	 *
36
+	 * {@inheritdoc}
37
+	 * @return self
38
+	 */
39
+	protected static function _fromDER(string $data, bool $critical): self
40
+	{
41
+		return new self($critical, Integer::fromDER($data)->intNumber());
42
+	}
43 43
     
44
-    /**
45
-     * Get value.
46
-     *
47
-     * @return int
48
-     */
49
-    public function skipCerts(): int
50
-    {
51
-        return $this->_skipCerts;
52
-    }
44
+	/**
45
+	 * Get value.
46
+	 *
47
+	 * @return int
48
+	 */
49
+	public function skipCerts(): int
50
+	{
51
+		return $this->_skipCerts;
52
+	}
53 53
     
54
-    /**
55
-     *
56
-     * {@inheritdoc}
57
-     * @return Integer
58
-     */
59
-    protected function _valueASN1(): Integer
60
-    {
61
-        return new Integer($this->_skipCerts);
62
-    }
54
+	/**
55
+	 *
56
+	 * {@inheritdoc}
57
+	 * @return Integer
58
+	 */
59
+	protected function _valueASN1(): Integer
60
+	{
61
+		return new Integer($this->_skipCerts);
62
+	}
63 63
 }
Please login to merge, or discard this patch.
lib/X509/Certificate/Extension/DistributionPoint/DistributionPointName.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -18,63 +18,63 @@
 block discarded – undo
18 18
  */
19 19
 abstract class DistributionPointName
20 20
 {
21
-    const TAG_FULL_NAME = 0;
22
-    const TAG_RDN = 1;
21
+	const TAG_FULL_NAME = 0;
22
+	const TAG_RDN = 1;
23 23
     
24
-    /**
25
-     * Type.
26
-     *
27
-     * @var int $_tag
28
-     */
29
-    protected $_tag;
24
+	/**
25
+	 * Type.
26
+	 *
27
+	 * @var int $_tag
28
+	 */
29
+	protected $_tag;
30 30
     
31
-    /**
32
-     * Generate ASN.1 element.
33
-     *
34
-     * @return Element
35
-     */
36
-    abstract protected function _valueASN1();
31
+	/**
32
+	 * Generate ASN.1 element.
33
+	 *
34
+	 * @return Element
35
+	 */
36
+	abstract protected function _valueASN1();
37 37
     
38
-    /**
39
-     * Initialize from TaggedType.
40
-     *
41
-     * @param TaggedType $el
42
-     * @throws \UnexpectedValueException
43
-     * @return self
44
-     */
45
-    public static function fromTaggedType(TaggedType $el): self
46
-    {
47
-        switch ($el->tag()) {
48
-            case self::TAG_FULL_NAME:
49
-                return new FullName(
50
-                    GeneralNames::fromASN1(
51
-                        $el->asImplicit(Element::TYPE_SEQUENCE)->asSequence()));
52
-            case self::TAG_RDN:
53
-                return new RelativeName(
54
-                    RDN::fromASN1($el->asImplicit(Element::TYPE_SET)->asSet()));
55
-            default:
56
-                throw new \UnexpectedValueException(
57
-                    "DistributionPointName tag " . $el->tag() . " not supported.");
58
-        }
59
-    }
38
+	/**
39
+	 * Initialize from TaggedType.
40
+	 *
41
+	 * @param TaggedType $el
42
+	 * @throws \UnexpectedValueException
43
+	 * @return self
44
+	 */
45
+	public static function fromTaggedType(TaggedType $el): self
46
+	{
47
+		switch ($el->tag()) {
48
+			case self::TAG_FULL_NAME:
49
+				return new FullName(
50
+					GeneralNames::fromASN1(
51
+						$el->asImplicit(Element::TYPE_SEQUENCE)->asSequence()));
52
+			case self::TAG_RDN:
53
+				return new RelativeName(
54
+					RDN::fromASN1($el->asImplicit(Element::TYPE_SET)->asSet()));
55
+			default:
56
+				throw new \UnexpectedValueException(
57
+					"DistributionPointName tag " . $el->tag() . " not supported.");
58
+		}
59
+	}
60 60
     
61
-    /**
62
-     * Get type tag.
63
-     *
64
-     * @return int
65
-     */
66
-    public function tag(): int
67
-    {
68
-        return $this->_tag;
69
-    }
61
+	/**
62
+	 * Get type tag.
63
+	 *
64
+	 * @return int
65
+	 */
66
+	public function tag(): int
67
+	{
68
+		return $this->_tag;
69
+	}
70 70
     
71
-    /**
72
-     * Generate ASN.1 structure.
73
-     *
74
-     * @return ImplicitlyTaggedType
75
-     */
76
-    public function toASN1(): ImplicitlyTaggedType
77
-    {
78
-        return new ImplicitlyTaggedType($this->_tag, $this->_valueASN1());
79
-    }
71
+	/**
72
+	 * Generate ASN.1 structure.
73
+	 *
74
+	 * @return ImplicitlyTaggedType
75
+	 */
76
+	public function toASN1(): ImplicitlyTaggedType
77
+	{
78
+		return new ImplicitlyTaggedType($this->_tag, $this->_valueASN1());
79
+	}
80 80
 }
Please login to merge, or discard this patch.
lib/X509/Certificate/Extension/DistributionPoint/RelativeName.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -16,41 +16,41 @@
 block discarded – undo
16 16
  */
17 17
 class RelativeName extends DistributionPointName
18 18
 {
19
-    /**
20
-     * Relative distinguished name.
21
-     *
22
-     * @var RDN $_rdn
23
-     */
24
-    protected $_rdn;
19
+	/**
20
+	 * Relative distinguished name.
21
+	 *
22
+	 * @var RDN $_rdn
23
+	 */
24
+	protected $_rdn;
25 25
     
26
-    /**
27
-     * Constructor.
28
-     *
29
-     * @param RDN $rdn
30
-     */
31
-    public function __construct(RDN $rdn)
32
-    {
33
-        $this->_tag = self::TAG_RDN;
34
-        $this->_rdn = $rdn;
35
-    }
26
+	/**
27
+	 * Constructor.
28
+	 *
29
+	 * @param RDN $rdn
30
+	 */
31
+	public function __construct(RDN $rdn)
32
+	{
33
+		$this->_tag = self::TAG_RDN;
34
+		$this->_rdn = $rdn;
35
+	}
36 36
     
37
-    /**
38
-     * Get RDN.
39
-     *
40
-     * @return RDN
41
-     */
42
-    public function rdn(): RDN
43
-    {
44
-        return $this->_rdn;
45
-    }
37
+	/**
38
+	 * Get RDN.
39
+	 *
40
+	 * @return RDN
41
+	 */
42
+	public function rdn(): RDN
43
+	{
44
+		return $this->_rdn;
45
+	}
46 46
     
47
-    /**
48
-     *
49
-     * {@inheritdoc}
50
-     * @return Set
51
-     */
52
-    protected function _valueASN1(): Set
53
-    {
54
-        return $this->_rdn->toASN1();
55
-    }
47
+	/**
48
+	 *
49
+	 * {@inheritdoc}
50
+	 * @return Set
51
+	 */
52
+	protected function _valueASN1(): Set
53
+	{
54
+		return $this->_rdn->toASN1();
55
+	}
56 56
 }
Please login to merge, or discard this patch.
lib/X509/Certificate/Extension/DistributionPoint/FullName.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -16,52 +16,52 @@
 block discarded – undo
16 16
  */
17 17
 class FullName extends DistributionPointName
18 18
 {
19
-    /**
20
-     * Names.
21
-     *
22
-     * @var GeneralNames $_names
23
-     */
24
-    protected $_names;
19
+	/**
20
+	 * Names.
21
+	 *
22
+	 * @var GeneralNames $_names
23
+	 */
24
+	protected $_names;
25 25
     
26
-    /**
27
-     * Constructor.
28
-     *
29
-     * @param GeneralNames $names
30
-     */
31
-    public function __construct(GeneralNames $names)
32
-    {
33
-        $this->_tag = self::TAG_FULL_NAME;
34
-        $this->_names = $names;
35
-    }
26
+	/**
27
+	 * Constructor.
28
+	 *
29
+	 * @param GeneralNames $names
30
+	 */
31
+	public function __construct(GeneralNames $names)
32
+	{
33
+		$this->_tag = self::TAG_FULL_NAME;
34
+		$this->_names = $names;
35
+	}
36 36
     
37
-    /**
38
-     * Initialize with a single URI.
39
-     *
40
-     * @param string $uri
41
-     * @return self
42
-     */
43
-    public static function fromURI(string $uri): self
44
-    {
45
-        return new self(new GeneralNames(new UniformResourceIdentifier($uri)));
46
-    }
37
+	/**
38
+	 * Initialize with a single URI.
39
+	 *
40
+	 * @param string $uri
41
+	 * @return self
42
+	 */
43
+	public static function fromURI(string $uri): self
44
+	{
45
+		return new self(new GeneralNames(new UniformResourceIdentifier($uri)));
46
+	}
47 47
     
48
-    /**
49
-     * Get names.
50
-     *
51
-     * @return GeneralNames
52
-     */
53
-    public function names(): GeneralNames
54
-    {
55
-        return $this->_names;
56
-    }
48
+	/**
49
+	 * Get names.
50
+	 *
51
+	 * @return GeneralNames
52
+	 */
53
+	public function names(): GeneralNames
54
+	{
55
+		return $this->_names;
56
+	}
57 57
     
58
-    /**
59
-     *
60
-     * {@inheritdoc}
61
-     * @return Sequence
62
-     */
63
-    protected function _valueASN1(): Sequence
64
-    {
65
-        return $this->_names->toASN1();
66
-    }
58
+	/**
59
+	 *
60
+	 * {@inheritdoc}
61
+	 * @return Sequence
62
+	 */
63
+	protected function _valueASN1(): Sequence
64
+	{
65
+		return $this->_names->toASN1();
66
+	}
67 67
 }
Please login to merge, or discard this patch.
lib/X509/Certificate/Extension/DistributionPoint/ReasonFlags.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -15,143 +15,143 @@
 block discarded – undo
15 15
  */
16 16
 class ReasonFlags
17 17
 {
18
-    // const UNUSED = 0x100;
19
-    const KEY_COMPROMISE = 0x080;
20
-    const CA_COMPROMISE = 0x040;
21
-    const AFFILIATION_CHANGED = 0x020;
22
-    const SUPERSEDED = 0x010;
23
-    const CESSATION_OF_OPERATION = 0x008;
24
-    const CERTIFICATE_HOLD = 0x004;
25
-    const PRIVILEGE_WITHDRAWN = 0x002;
26
-    const AA_COMPROMISE = 0x001;
18
+	// const UNUSED = 0x100;
19
+	const KEY_COMPROMISE = 0x080;
20
+	const CA_COMPROMISE = 0x040;
21
+	const AFFILIATION_CHANGED = 0x020;
22
+	const SUPERSEDED = 0x010;
23
+	const CESSATION_OF_OPERATION = 0x008;
24
+	const CERTIFICATE_HOLD = 0x004;
25
+	const PRIVILEGE_WITHDRAWN = 0x002;
26
+	const AA_COMPROMISE = 0x001;
27 27
     
28
-    /**
29
-     * Flags.
30
-     *
31
-     * @var int $_flags
32
-     */
33
-    protected $_flags;
28
+	/**
29
+	 * Flags.
30
+	 *
31
+	 * @var int $_flags
32
+	 */
33
+	protected $_flags;
34 34
     
35
-    /**
36
-     * Constructor.
37
-     *
38
-     * @param int $flags
39
-     */
40
-    public function __construct(int $flags)
41
-    {
42
-        $this->_flags = $flags;
43
-    }
35
+	/**
36
+	 * Constructor.
37
+	 *
38
+	 * @param int $flags
39
+	 */
40
+	public function __construct(int $flags)
41
+	{
42
+		$this->_flags = $flags;
43
+	}
44 44
     
45
-    /**
46
-     * Initialize from ASN.1.
47
-     *
48
-     * @param BitString $bs
49
-     * @return self
50
-     */
51
-    public static function fromASN1(BitString $bs): self
52
-    {
53
-        return new self(Flags::fromBitString($bs, 9)->intNumber());
54
-    }
45
+	/**
46
+	 * Initialize from ASN.1.
47
+	 *
48
+	 * @param BitString $bs
49
+	 * @return self
50
+	 */
51
+	public static function fromASN1(BitString $bs): self
52
+	{
53
+		return new self(Flags::fromBitString($bs, 9)->intNumber());
54
+	}
55 55
     
56
-    /**
57
-     * Check whether keyCompromise flag is set.
58
-     *
59
-     * @return bool
60
-     */
61
-    public function isKeyCompromise(): bool
62
-    {
63
-        return $this->_flagSet(self::KEY_COMPROMISE);
64
-    }
56
+	/**
57
+	 * Check whether keyCompromise flag is set.
58
+	 *
59
+	 * @return bool
60
+	 */
61
+	public function isKeyCompromise(): bool
62
+	{
63
+		return $this->_flagSet(self::KEY_COMPROMISE);
64
+	}
65 65
     
66
-    /**
67
-     * Check whether cACompromise flag is set.
68
-     *
69
-     * @return bool
70
-     */
71
-    public function isCACompromise(): bool
72
-    {
73
-        return $this->_flagSet(self::CA_COMPROMISE);
74
-    }
66
+	/**
67
+	 * Check whether cACompromise flag is set.
68
+	 *
69
+	 * @return bool
70
+	 */
71
+	public function isCACompromise(): bool
72
+	{
73
+		return $this->_flagSet(self::CA_COMPROMISE);
74
+	}
75 75
     
76
-    /**
77
-     * Check whether affiliationChanged flag is set.
78
-     *
79
-     * @return bool
80
-     */
81
-    public function isAffiliationChanged(): bool
82
-    {
83
-        return $this->_flagSet(self::AFFILIATION_CHANGED);
84
-    }
76
+	/**
77
+	 * Check whether affiliationChanged flag is set.
78
+	 *
79
+	 * @return bool
80
+	 */
81
+	public function isAffiliationChanged(): bool
82
+	{
83
+		return $this->_flagSet(self::AFFILIATION_CHANGED);
84
+	}
85 85
     
86
-    /**
87
-     * Check whether superseded flag is set.
88
-     *
89
-     * @return bool
90
-     */
91
-    public function isSuperseded(): bool
92
-    {
93
-        return $this->_flagSet(self::SUPERSEDED);
94
-    }
86
+	/**
87
+	 * Check whether superseded flag is set.
88
+	 *
89
+	 * @return bool
90
+	 */
91
+	public function isSuperseded(): bool
92
+	{
93
+		return $this->_flagSet(self::SUPERSEDED);
94
+	}
95 95
     
96
-    /**
97
-     * Check whether cessationOfOperation flag is set.
98
-     *
99
-     * @return bool
100
-     */
101
-    public function isCessationOfOperation(): bool
102
-    {
103
-        return $this->_flagSet(self::CESSATION_OF_OPERATION);
104
-    }
96
+	/**
97
+	 * Check whether cessationOfOperation flag is set.
98
+	 *
99
+	 * @return bool
100
+	 */
101
+	public function isCessationOfOperation(): bool
102
+	{
103
+		return $this->_flagSet(self::CESSATION_OF_OPERATION);
104
+	}
105 105
     
106
-    /**
107
-     * Check whether certificateHold flag is set.
108
-     *
109
-     * @return bool
110
-     */
111
-    public function isCertificateHold(): bool
112
-    {
113
-        return $this->_flagSet(self::CERTIFICATE_HOLD);
114
-    }
106
+	/**
107
+	 * Check whether certificateHold flag is set.
108
+	 *
109
+	 * @return bool
110
+	 */
111
+	public function isCertificateHold(): bool
112
+	{
113
+		return $this->_flagSet(self::CERTIFICATE_HOLD);
114
+	}
115 115
     
116
-    /**
117
-     * Check whether privilegeWithdrawn flag is set.
118
-     *
119
-     * @return bool
120
-     */
121
-    public function isPrivilegeWithdrawn(): bool
122
-    {
123
-        return $this->_flagSet(self::PRIVILEGE_WITHDRAWN);
124
-    }
116
+	/**
117
+	 * Check whether privilegeWithdrawn flag is set.
118
+	 *
119
+	 * @return bool
120
+	 */
121
+	public function isPrivilegeWithdrawn(): bool
122
+	{
123
+		return $this->_flagSet(self::PRIVILEGE_WITHDRAWN);
124
+	}
125 125
     
126
-    /**
127
-     * Check whether aACompromise flag is set.
128
-     *
129
-     * @return bool
130
-     */
131
-    public function isAACompromise(): bool
132
-    {
133
-        return $this->_flagSet(self::AA_COMPROMISE);
134
-    }
126
+	/**
127
+	 * Check whether aACompromise flag is set.
128
+	 *
129
+	 * @return bool
130
+	 */
131
+	public function isAACompromise(): bool
132
+	{
133
+		return $this->_flagSet(self::AA_COMPROMISE);
134
+	}
135 135
     
136
-    /**
137
-     * Generate ASN.1 element.
138
-     *
139
-     * @return BitString
140
-     */
141
-    public function toASN1(): BitString
142
-    {
143
-        $flags = new Flags($this->_flags, 9);
144
-        return $flags->bitString()->withoutTrailingZeroes();
145
-    }
136
+	/**
137
+	 * Generate ASN.1 element.
138
+	 *
139
+	 * @return BitString
140
+	 */
141
+	public function toASN1(): BitString
142
+	{
143
+		$flags = new Flags($this->_flags, 9);
144
+		return $flags->bitString()->withoutTrailingZeroes();
145
+	}
146 146
     
147
-    /**
148
-     * Check whether given flag is set.
149
-     *
150
-     * @param int $flag
151
-     * @return boolean
152
-     */
153
-    protected function _flagSet(int $flag): bool
154
-    {
155
-        return (bool) ($this->_flags & $flag);
156
-    }
147
+	/**
148
+	 * Check whether given flag is set.
149
+	 *
150
+	 * @param int $flag
151
+	 * @return boolean
152
+	 */
153
+	protected function _flagSet(int $flag): bool
154
+	{
155
+		return (bool) ($this->_flags & $flag);
156
+	}
157 157
 }
Please login to merge, or discard this patch.
lib/X509/Certificate/Extension/DistributionPoint/DistributionPoint.php 1 patch
Indentation   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -18,215 +18,215 @@
 block discarded – undo
18 18
  */
19 19
 class DistributionPoint
20 20
 {
21
-    /**
22
-     * Distribution point name.
23
-     *
24
-     * @var DistributionPointName $_distributionPoint
25
-     */
26
-    protected $_distributionPoint;
21
+	/**
22
+	 * Distribution point name.
23
+	 *
24
+	 * @var DistributionPointName $_distributionPoint
25
+	 */
26
+	protected $_distributionPoint;
27 27
     
28
-    /**
29
-     * Revocation reason.
30
-     *
31
-     * @var ReasonFlags $_reasons
32
-     */
33
-    protected $_reasons;
28
+	/**
29
+	 * Revocation reason.
30
+	 *
31
+	 * @var ReasonFlags $_reasons
32
+	 */
33
+	protected $_reasons;
34 34
     
35
-    /**
36
-     * CRL issuer.
37
-     *
38
-     * @var GeneralNames $_issuer
39
-     */
40
-    protected $_issuer;
35
+	/**
36
+	 * CRL issuer.
37
+	 *
38
+	 * @var GeneralNames $_issuer
39
+	 */
40
+	protected $_issuer;
41 41
     
42
-    /**
43
-     * Constructor.
44
-     *
45
-     * @param DistributionPointName $name
46
-     * @param ReasonFlags $reasons
47
-     * @param GeneralNames $issuer
48
-     */
49
-    public function __construct(DistributionPointName $name = null,
50
-        ReasonFlags $reasons = null, GeneralNames $issuer = null)
51
-    {
52
-        $this->_distributionPoint = $name;
53
-        $this->_reasons = $reasons;
54
-        $this->_issuer = $issuer;
55
-    }
42
+	/**
43
+	 * Constructor.
44
+	 *
45
+	 * @param DistributionPointName $name
46
+	 * @param ReasonFlags $reasons
47
+	 * @param GeneralNames $issuer
48
+	 */
49
+	public function __construct(DistributionPointName $name = null,
50
+		ReasonFlags $reasons = null, GeneralNames $issuer = null)
51
+	{
52
+		$this->_distributionPoint = $name;
53
+		$this->_reasons = $reasons;
54
+		$this->_issuer = $issuer;
55
+	}
56 56
     
57
-    /**
58
-     * Initialize from ASN.1.
59
-     *
60
-     * @param Sequence $seq
61
-     * @return self
62
-     */
63
-    public static function fromASN1(Sequence $seq): self
64
-    {
65
-        $name = null;
66
-        $reasons = null;
67
-        $issuer = null;
68
-        if ($seq->hasTagged(0)) {
69
-            // promoted to explicit tagging because underlying type is CHOICE
70
-            $name = DistributionPointName::fromTaggedType(
71
-                $seq->getTagged(0)
72
-                    ->asExplicit()
73
-                    ->asTagged());
74
-        }
75
-        if ($seq->hasTagged(1)) {
76
-            $reasons = ReasonFlags::fromASN1(
77
-                $seq->getTagged(1)
78
-                    ->asImplicit(Element::TYPE_BIT_STRING)
79
-                    ->asBitString());
80
-        }
81
-        if ($seq->hasTagged(2)) {
82
-            $issuer = GeneralNames::fromASN1(
83
-                $seq->getTagged(2)
84
-                    ->asImplicit(Element::TYPE_SEQUENCE)
85
-                    ->asSequence());
86
-        }
87
-        return new self($name, $reasons, $issuer);
88
-    }
57
+	/**
58
+	 * Initialize from ASN.1.
59
+	 *
60
+	 * @param Sequence $seq
61
+	 * @return self
62
+	 */
63
+	public static function fromASN1(Sequence $seq): self
64
+	{
65
+		$name = null;
66
+		$reasons = null;
67
+		$issuer = null;
68
+		if ($seq->hasTagged(0)) {
69
+			// promoted to explicit tagging because underlying type is CHOICE
70
+			$name = DistributionPointName::fromTaggedType(
71
+				$seq->getTagged(0)
72
+					->asExplicit()
73
+					->asTagged());
74
+		}
75
+		if ($seq->hasTagged(1)) {
76
+			$reasons = ReasonFlags::fromASN1(
77
+				$seq->getTagged(1)
78
+					->asImplicit(Element::TYPE_BIT_STRING)
79
+					->asBitString());
80
+		}
81
+		if ($seq->hasTagged(2)) {
82
+			$issuer = GeneralNames::fromASN1(
83
+				$seq->getTagged(2)
84
+					->asImplicit(Element::TYPE_SEQUENCE)
85
+					->asSequence());
86
+		}
87
+		return new self($name, $reasons, $issuer);
88
+	}
89 89
     
90
-    /**
91
-     * Check whether distribution point name is set.
92
-     *
93
-     * @return bool
94
-     */
95
-    public function hasDistributionPointName(): bool
96
-    {
97
-        return isset($this->_distributionPoint);
98
-    }
90
+	/**
91
+	 * Check whether distribution point name is set.
92
+	 *
93
+	 * @return bool
94
+	 */
95
+	public function hasDistributionPointName(): bool
96
+	{
97
+		return isset($this->_distributionPoint);
98
+	}
99 99
     
100
-    /**
101
-     * Get distribution point name.
102
-     *
103
-     * @throws \LogicException
104
-     * @return DistributionPointName
105
-     */
106
-    public function distributionPointName(): DistributionPointName
107
-    {
108
-        if (!$this->hasDistributionPointName()) {
109
-            throw new \LogicException("distributionPoint not set.");
110
-        }
111
-        return $this->_distributionPoint;
112
-    }
100
+	/**
101
+	 * Get distribution point name.
102
+	 *
103
+	 * @throws \LogicException
104
+	 * @return DistributionPointName
105
+	 */
106
+	public function distributionPointName(): DistributionPointName
107
+	{
108
+		if (!$this->hasDistributionPointName()) {
109
+			throw new \LogicException("distributionPoint not set.");
110
+		}
111
+		return $this->_distributionPoint;
112
+	}
113 113
     
114
-    /**
115
-     * Check whether distribution point name is set and it's a full name.
116
-     *
117
-     * @return bool
118
-     */
119
-    public function hasFullName(): bool
120
-    {
121
-        return $this->distributionPointName()->tag() ==
122
-             DistributionPointName::TAG_FULL_NAME;
123
-    }
114
+	/**
115
+	 * Check whether distribution point name is set and it's a full name.
116
+	 *
117
+	 * @return bool
118
+	 */
119
+	public function hasFullName(): bool
120
+	{
121
+		return $this->distributionPointName()->tag() ==
122
+			 DistributionPointName::TAG_FULL_NAME;
123
+	}
124 124
     
125
-    /**
126
-     * Get full distribution point name.
127
-     *
128
-     * @throws \LogicException
129
-     * @return FullName
130
-     */
131
-    public function fullName(): FullName
132
-    {
133
-        if (!$this->hasFullName()) {
134
-            throw new \LogicException("fullName not set.");
135
-        }
136
-        return $this->_distributionPoint;
137
-    }
125
+	/**
126
+	 * Get full distribution point name.
127
+	 *
128
+	 * @throws \LogicException
129
+	 * @return FullName
130
+	 */
131
+	public function fullName(): FullName
132
+	{
133
+		if (!$this->hasFullName()) {
134
+			throw new \LogicException("fullName not set.");
135
+		}
136
+		return $this->_distributionPoint;
137
+	}
138 138
     
139
-    /**
140
-     * Check whether distribution point name is set and it's a relative name.
141
-     *
142
-     * @return bool
143
-     */
144
-    public function hasRelativeName(): bool
145
-    {
146
-        return $this->distributionPointName()->tag() ==
147
-             DistributionPointName::TAG_RDN;
148
-    }
139
+	/**
140
+	 * Check whether distribution point name is set and it's a relative name.
141
+	 *
142
+	 * @return bool
143
+	 */
144
+	public function hasRelativeName(): bool
145
+	{
146
+		return $this->distributionPointName()->tag() ==
147
+			 DistributionPointName::TAG_RDN;
148
+	}
149 149
     
150
-    /**
151
-     * Get relative distribution point name.
152
-     *
153
-     * @throws \LogicException
154
-     * @return RelativeName
155
-     */
156
-    public function relativeName(): RelativeName
157
-    {
158
-        if (!$this->hasRelativeName()) {
159
-            throw new \LogicException("nameRelativeToCRLIssuer not set.");
160
-        }
161
-        return $this->_distributionPoint;
162
-    }
150
+	/**
151
+	 * Get relative distribution point name.
152
+	 *
153
+	 * @throws \LogicException
154
+	 * @return RelativeName
155
+	 */
156
+	public function relativeName(): RelativeName
157
+	{
158
+		if (!$this->hasRelativeName()) {
159
+			throw new \LogicException("nameRelativeToCRLIssuer not set.");
160
+		}
161
+		return $this->_distributionPoint;
162
+	}
163 163
     
164
-    /**
165
-     * Check whether reasons flags is set.
166
-     *
167
-     * @return bool
168
-     */
169
-    public function hasReasons(): bool
170
-    {
171
-        return isset($this->_reasons);
172
-    }
164
+	/**
165
+	 * Check whether reasons flags is set.
166
+	 *
167
+	 * @return bool
168
+	 */
169
+	public function hasReasons(): bool
170
+	{
171
+		return isset($this->_reasons);
172
+	}
173 173
     
174
-    /**
175
-     * Get revocation reason flags.
176
-     *
177
-     * @throws \LogicException
178
-     * @return ReasonFlags
179
-     */
180
-    public function reasons(): ReasonFlags
181
-    {
182
-        if (!$this->hasReasons()) {
183
-            throw new \LogicException("reasons not set.");
184
-        }
185
-        return $this->_reasons;
186
-    }
174
+	/**
175
+	 * Get revocation reason flags.
176
+	 *
177
+	 * @throws \LogicException
178
+	 * @return ReasonFlags
179
+	 */
180
+	public function reasons(): ReasonFlags
181
+	{
182
+		if (!$this->hasReasons()) {
183
+			throw new \LogicException("reasons not set.");
184
+		}
185
+		return $this->_reasons;
186
+	}
187 187
     
188
-    /**
189
-     * Check whether cRLIssuer is set.
190
-     *
191
-     * @return bool
192
-     */
193
-    public function hasCRLIssuer(): bool
194
-    {
195
-        return isset($this->_issuer);
196
-    }
188
+	/**
189
+	 * Check whether cRLIssuer is set.
190
+	 *
191
+	 * @return bool
192
+	 */
193
+	public function hasCRLIssuer(): bool
194
+	{
195
+		return isset($this->_issuer);
196
+	}
197 197
     
198
-    /**
199
-     * Get CRL issuer.
200
-     *
201
-     * @throws \LogicException
202
-     * @return GeneralNames
203
-     */
204
-    public function crlIssuer(): GeneralNames
205
-    {
206
-        if (!$this->hasCRLIssuer()) {
207
-            throw new \LogicException("crlIssuer not set.");
208
-        }
209
-        return $this->_issuer;
210
-    }
198
+	/**
199
+	 * Get CRL issuer.
200
+	 *
201
+	 * @throws \LogicException
202
+	 * @return GeneralNames
203
+	 */
204
+	public function crlIssuer(): GeneralNames
205
+	{
206
+		if (!$this->hasCRLIssuer()) {
207
+			throw new \LogicException("crlIssuer not set.");
208
+		}
209
+		return $this->_issuer;
210
+	}
211 211
     
212
-    /**
213
-     * Generate ASN.1 structure.
214
-     *
215
-     * @return Sequence
216
-     */
217
-    public function toASN1(): Sequence
218
-    {
219
-        $elements = array();
220
-        if (isset($this->_distributionPoint)) {
221
-            $elements[] = new ExplicitlyTaggedType(0,
222
-                $this->_distributionPoint->toASN1());
223
-        }
224
-        if (isset($this->_reasons)) {
225
-            $elements[] = new ImplicitlyTaggedType(1, $this->_reasons->toASN1());
226
-        }
227
-        if (isset($this->_issuer)) {
228
-            $elements[] = new ImplicitlyTaggedType(2, $this->_issuer->toASN1());
229
-        }
230
-        return new Sequence(...$elements);
231
-    }
212
+	/**
213
+	 * Generate ASN.1 structure.
214
+	 *
215
+	 * @return Sequence
216
+	 */
217
+	public function toASN1(): Sequence
218
+	{
219
+		$elements = array();
220
+		if (isset($this->_distributionPoint)) {
221
+			$elements[] = new ExplicitlyTaggedType(0,
222
+				$this->_distributionPoint->toASN1());
223
+		}
224
+		if (isset($this->_reasons)) {
225
+			$elements[] = new ImplicitlyTaggedType(1, $this->_reasons->toASN1());
226
+		}
227
+		if (isset($this->_issuer)) {
228
+			$elements[] = new ImplicitlyTaggedType(2, $this->_issuer->toASN1());
229
+		}
230
+		return new Sequence(...$elements);
231
+	}
232 232
 }
Please login to merge, or discard this patch.
lib/X509/Certificate/Extension/BasicConstraintsExtension.php 1 patch
Indentation   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -16,106 +16,106 @@
 block discarded – undo
16 16
  */
17 17
 class BasicConstraintsExtension extends Extension
18 18
 {
19
-    /**
20
-     * Whether certificate is a CA.
21
-     *
22
-     * @var boolean $_ca
23
-     */
24
-    protected $_ca;
19
+	/**
20
+	 * Whether certificate is a CA.
21
+	 *
22
+	 * @var boolean $_ca
23
+	 */
24
+	protected $_ca;
25 25
     
26
-    /**
27
-     * Maximum certification path length.
28
-     *
29
-     * @var int|null $_pathLen
30
-     */
31
-    protected $_pathLen;
26
+	/**
27
+	 * Maximum certification path length.
28
+	 *
29
+	 * @var int|null $_pathLen
30
+	 */
31
+	protected $_pathLen;
32 32
     
33
-    /**
34
-     * Constructor.
35
-     *
36
-     * @param bool $critical
37
-     * @param bool $ca
38
-     * @param int|null $path_len
39
-     */
40
-    public function __construct(bool $critical, bool $ca, $path_len = null)
41
-    {
42
-        parent::__construct(self::OID_BASIC_CONSTRAINTS, $critical);
43
-        $this->_ca = $ca;
44
-        $this->_pathLen = isset($path_len) ? intval($path_len) : null;
45
-    }
33
+	/**
34
+	 * Constructor.
35
+	 *
36
+	 * @param bool $critical
37
+	 * @param bool $ca
38
+	 * @param int|null $path_len
39
+	 */
40
+	public function __construct(bool $critical, bool $ca, $path_len = null)
41
+	{
42
+		parent::__construct(self::OID_BASIC_CONSTRAINTS, $critical);
43
+		$this->_ca = $ca;
44
+		$this->_pathLen = isset($path_len) ? intval($path_len) : null;
45
+	}
46 46
     
47
-    /**
48
-     *
49
-     * {@inheritdoc}
50
-     * @return self
51
-     */
52
-    protected static function _fromDER(string $data, bool $critical): self
53
-    {
54
-        $seq = Sequence::fromDER($data);
55
-        $ca = false;
56
-        $path_len = null;
57
-        $idx = 0;
58
-        if ($seq->has($idx, Element::TYPE_BOOLEAN)) {
59
-            $ca = $seq->at($idx++)
60
-                ->asBoolean()
61
-                ->value();
62
-        }
63
-        if ($seq->has($idx, Element::TYPE_INTEGER)) {
64
-            $path_len = $seq->at($idx)
65
-                ->asInteger()
66
-                ->intNumber();
67
-        }
68
-        return new self($critical, $ca, $path_len);
69
-    }
47
+	/**
48
+	 *
49
+	 * {@inheritdoc}
50
+	 * @return self
51
+	 */
52
+	protected static function _fromDER(string $data, bool $critical): self
53
+	{
54
+		$seq = Sequence::fromDER($data);
55
+		$ca = false;
56
+		$path_len = null;
57
+		$idx = 0;
58
+		if ($seq->has($idx, Element::TYPE_BOOLEAN)) {
59
+			$ca = $seq->at($idx++)
60
+				->asBoolean()
61
+				->value();
62
+		}
63
+		if ($seq->has($idx, Element::TYPE_INTEGER)) {
64
+			$path_len = $seq->at($idx)
65
+				->asInteger()
66
+				->intNumber();
67
+		}
68
+		return new self($critical, $ca, $path_len);
69
+	}
70 70
     
71
-    /**
72
-     * Whether certificate is a CA.
73
-     *
74
-     * @return bool
75
-     */
76
-    public function isCA(): bool
77
-    {
78
-        return $this->_ca;
79
-    }
71
+	/**
72
+	 * Whether certificate is a CA.
73
+	 *
74
+	 * @return bool
75
+	 */
76
+	public function isCA(): bool
77
+	{
78
+		return $this->_ca;
79
+	}
80 80
     
81
-    /**
82
-     * Whether path length is present.
83
-     *
84
-     * @return bool
85
-     */
86
-    public function hasPathLen(): bool
87
-    {
88
-        return isset($this->_pathLen);
89
-    }
81
+	/**
82
+	 * Whether path length is present.
83
+	 *
84
+	 * @return bool
85
+	 */
86
+	public function hasPathLen(): bool
87
+	{
88
+		return isset($this->_pathLen);
89
+	}
90 90
     
91
-    /**
92
-     * Get path length.
93
-     *
94
-     * @throws \LogicException
95
-     * @return int
96
-     */
97
-    public function pathLen(): int
98
-    {
99
-        if (!$this->hasPathLen()) {
100
-            throw new \LogicException("pathLenConstraint not set.");
101
-        }
102
-        return $this->_pathLen;
103
-    }
91
+	/**
92
+	 * Get path length.
93
+	 *
94
+	 * @throws \LogicException
95
+	 * @return int
96
+	 */
97
+	public function pathLen(): int
98
+	{
99
+		if (!$this->hasPathLen()) {
100
+			throw new \LogicException("pathLenConstraint not set.");
101
+		}
102
+		return $this->_pathLen;
103
+	}
104 104
     
105
-    /**
106
-     *
107
-     * {@inheritdoc}
108
-     * @return Sequence
109
-     */
110
-    protected function _valueASN1(): Sequence
111
-    {
112
-        $elements = array();
113
-        if ($this->_ca) {
114
-            $elements[] = new Boolean(true);
115
-        }
116
-        if (isset($this->_pathLen)) {
117
-            $elements[] = new Integer($this->_pathLen);
118
-        }
119
-        return new Sequence(...$elements);
120
-    }
105
+	/**
106
+	 *
107
+	 * {@inheritdoc}
108
+	 * @return Sequence
109
+	 */
110
+	protected function _valueASN1(): Sequence
111
+	{
112
+		$elements = array();
113
+		if ($this->_ca) {
114
+			$elements[] = new Boolean(true);
115
+		}
116
+		if (isset($this->_pathLen)) {
117
+			$elements[] = new Integer($this->_pathLen);
118
+		}
119
+		return new Sequence(...$elements);
120
+	}
121 121
 }
Please login to merge, or discard this patch.