| @@ -50,6 +50,7 @@ | ||
| 50 | 50 | * @param Crypto $crypto | 
| 51 | 51 | * @param PathValidationConfig $config | 
| 52 | 52 | * @param Certificate ...$certificates | 
| 53 | + * @param Certificate[] $certificates | |
| 53 | 54 | */ | 
| 54 | 55 | public function __construct(Crypto $crypto, PathValidationConfig $config, | 
| 55 | 56 |  			Certificate ...$certificates) { | 
| @@ -4,7 +4,6 @@ | ||
| 4 | 4 | |
| 5 | 5 | use CryptoUtil\Crypto\Crypto; | 
| 6 | 6 | use X509\Certificate\Certificate; | 
| 7 | -use X509\Certificate\Extension\Extension; | |
| 8 | 7 | use X509\Certificate\TBSCertificate; | 
| 9 | 8 | use X509\CertificationPath\Exception\PathValidationException; | 
| 10 | 9 | |
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | |
| 33 | 33 |  	protected static function _wordsToIPv6String(array $words) { | 
| 34 | 34 | $groups = array_map( | 
| 35 | -			function ($word) { | |
| 35 | +			function($word) { | |
| 36 | 36 |  				return sprintf("%04x", $word); | 
| 37 | 37 | }, $words); | 
| 38 | 38 |  		return implode(":", $groups); | 
| @@ -35,7 +35,7 @@ | ||
| 35 | 35 | */ | 
| 36 | 36 |  	public static function fromPEMs(PEM ...$pems) { | 
| 37 | 37 | $certs = array_map( | 
| 38 | -			function ($pem) { | |
| 38 | +			function($pem) { | |
| 39 | 39 | return Certificate::fromPEM($pem); | 
| 40 | 40 | }, $pems); | 
| 41 | 41 | return new self(...$certs); | 
| @@ -70,7 +70,7 @@ discard block | ||
| 70 | 70 |  	public function allOf($name) { | 
| 71 | 71 | $oid = AttributeType::attrNameToOID($name); | 
| 72 | 72 | $attrs = array_filter($this->_attributes, | 
| 73 | -			function (Attribute $attr) use ($oid) { | |
| 73 | +			function(Attribute $attr) use ($oid) { | |
| 74 | 74 | return $attr->oid() == $oid; | 
| 75 | 75 | }); | 
| 76 | 76 | return array_values($attrs); | 
| @@ -110,7 +110,7 @@ discard block | ||
| 110 | 110 |  	public function withUnique(Attribute $attr) { | 
| 111 | 111 | $obj = clone $this; | 
| 112 | 112 | $obj->_attributes = array_filter($obj->_attributes, | 
| 113 | -			function (Attribute $a) use ($attr) { | |
| 113 | +			function(Attribute $a) use ($attr) { | |
| 114 | 114 | return $a->oid() != $attr->oid(); | 
| 115 | 115 | }); | 
| 116 | 116 | $obj->_attributes[] = $attr; | 
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 | $paths = $this->_resolvePathsToTarget($target, $intermediate); | 
| 46 | 46 | // map paths to CertificationPath objects | 
| 47 | 47 | return array_map( | 
| 48 | -			function ($certs) { | |
| 48 | +			function($certs) { | |
| 49 | 49 | return new CertificationPath(...$certs); | 
| 50 | 50 | }, $paths); | 
| 51 | 51 | } | 
| @@ -108,7 +108,7 @@ discard block | ||
| 108 | 108 |  			throw new PathBuildingException("No certification paths."); | 
| 109 | 109 | } | 
| 110 | 110 | usort($paths, | 
| 111 | -			function ($a, $b) { | |
| 111 | +			function($a, $b) { | |
| 112 | 112 | return count($a) < count($b) ? -1 : 1; | 
| 113 | 113 | }); | 
| 114 | 114 | return reset($paths); | 
| @@ -31,7 +31,7 @@ discard block | ||
| 31 | 31 | |
| 32 | 32 |  	protected static function _fromDER($data, $critical) { | 
| 33 | 33 | $attribs = array_map( | 
| 34 | -			function (UnspecifiedType $el) { | |
| 34 | +			function(UnspecifiedType $el) { | |
| 35 | 35 | return Attribute::fromASN1($el->asSequence()); | 
| 36 | 36 | }, Sequence::fromDER($data)->elements()); | 
| 37 | 37 |  		if (!count($attribs)) { | 
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 |  			throw new \LogicException("No attributes"); | 
| 47 | 47 | } | 
| 48 | 48 | $elements = array_map( | 
| 49 | -			function (Attribute $attr) { | |
| 49 | +			function(Attribute $attr) { | |
| 50 | 50 | return $attr->toASN1(); | 
| 51 | 51 | }, array_values($this->_attributes)); | 
| 52 | 52 | return new Sequence(...$elements); | 
| @@ -36,7 +36,7 @@ discard block | ||
| 36 | 36 | |
| 37 | 37 |  	protected static function _fromDER($data, $critical) { | 
| 38 | 38 | $dps = array_map( | 
| 39 | -			function (UnspecifiedType $el) { | |
| 39 | +			function(UnspecifiedType $el) { | |
| 40 | 40 | return DistributionPoint::fromASN1($el->asSequence()); | 
| 41 | 41 | }, Sequence::fromDER($data)->elements()); | 
| 42 | 42 |  		if (!count($dps)) { | 
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 |  			throw new \LogicException("No distribution points."); | 
| 54 | 54 | } | 
| 55 | 55 | $elements = array_map( | 
| 56 | -			function (DistributionPoint $dp) { | |
| 56 | +			function(DistributionPoint $dp) { | |
| 57 | 57 | return $dp->toASN1(); | 
| 58 | 58 | }, $this->_distributionPoints); | 
| 59 | 59 | return new Sequence(...$elements); | 
| @@ -38,7 +38,7 @@ discard block | ||
| 38 | 38 | |
| 39 | 39 |  	protected static function _fromDER($data, $critical) { | 
| 40 | 40 | $policies = array_map( | 
| 41 | -			function (UnspecifiedType $el) { | |
| 41 | +			function(UnspecifiedType $el) { | |
| 42 | 42 | return PolicyInformation::fromASN1($el->asSequence()); | 
| 43 | 43 | }, Sequence::fromDER($data)->elements()); | 
| 44 | 44 |  		if (!count($policies)) { | 
| @@ -78,7 +78,7 @@ discard block | ||
| 78 | 78 |  			throw new \LogicException("No policies."); | 
| 79 | 79 | } | 
| 80 | 80 | $elements = array_map( | 
| 81 | -			function (PolicyInformation $pi) { | |
| 81 | +			function(PolicyInformation $pi) { | |
| 82 | 82 | return $pi->toASN1(); | 
| 83 | 83 | }, array_values($this->_policies)); | 
| 84 | 84 | return new Sequence(...$elements); | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 |  	public static function fromASN1(Sequence $seq) { | 
| 50 | 50 | $org = DisplayText::fromASN1($seq->at(0)->asString()); | 
| 51 | 51 | $numbers = array_map( | 
| 52 | -			function (UnspecifiedType $el) { | |
| 52 | +			function(UnspecifiedType $el) { | |
| 53 | 53 | return $el->asInteger()->number(); | 
| 54 | 54 | }, $seq->at(1) | 
| 55 | 55 | ->asSequence() | 
| @@ -83,7 +83,7 @@ discard block | ||
| 83 | 83 |  	public function toASN1() { | 
| 84 | 84 | $org = $this->_organization->toASN1(); | 
| 85 | 85 | $nums = array_map( | 
| 86 | -			function ($number) { | |
| 86 | +			function($number) { | |
| 87 | 87 | return new Integer($number); | 
| 88 | 88 | }, $this->_numbers); | 
| 89 | 89 | return new Sequence($org, new Sequence(...$nums)); |