1 | <?php |
||
15 | abstract class GeneralName |
||
16 | { |
||
17 | // GeneralName CHOICE tags |
||
18 | const TAG_OTHER_NAME = 0; |
||
19 | const TAG_RFC822_NAME = 1; |
||
20 | const TAG_DNS_NAME = 2; |
||
21 | const TAG_X400_ADDRESS = 3; |
||
22 | const TAG_DIRECTORY_NAME = 4; |
||
23 | const TAG_EDI_PARTY_NAME = 5; |
||
24 | const TAG_URI = 6; |
||
25 | const TAG_IP_ADDRESS = 7; |
||
26 | const TAG_REGISTERED_ID = 8; |
||
27 | |||
28 | /** |
||
29 | * Chosen tag. |
||
30 | * |
||
31 | * @var int $_tag |
||
32 | */ |
||
33 | protected $_tag; |
||
34 | |||
35 | /** |
||
36 | * Get string value of the type. |
||
37 | * |
||
38 | * @return string |
||
39 | */ |
||
40 | abstract public function string(); |
||
41 | |||
42 | /** |
||
43 | * Get ASN.1 value in GeneralName CHOICE context. |
||
44 | * |
||
45 | * @return TaggedType |
||
46 | */ |
||
47 | abstract protected function _choiceASN1(); |
||
48 | |||
49 | /** |
||
50 | * Initialize concrete object from the chosen ASN.1 element. |
||
51 | * |
||
52 | * @param UnspecifiedType $el |
||
53 | * @return self |
||
54 | */ |
||
55 | 1 | public static function fromChosenASN1(UnspecifiedType $el) { |
|
56 | 1 | throw new \BadMethodCallException( |
|
57 | 1 | __FUNCTION__ . " must be implemented in the derived class."); |
|
58 | 1 | } |
|
59 | |||
60 | /** |
||
61 | * Initialize from ASN.1. |
||
62 | * |
||
63 | * @param TaggedType $el |
||
64 | * @throws \UnexpectedValueException |
||
65 | * @return self |
||
66 | */ |
||
67 | 57 | public static function fromASN1(TaggedType $el) { |
|
111 | |||
112 | /** |
||
113 | * Get type tag. |
||
114 | * |
||
115 | * @return int |
||
116 | */ |
||
117 | 32 | public function tag() { |
|
120 | |||
121 | /** |
||
122 | * Generate ASN.1 element. |
||
123 | * |
||
124 | * @return Element |
||
125 | */ |
||
126 | 67 | public function toASN1() { |
|
129 | |||
130 | /** |
||
131 | * Get general name as a string. |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | 8 | public function __toString() { |
|
138 | } |
||
139 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.