@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | * @throws InvalidJWKType |
41 | 41 | * @throws InvalidJWKUseException |
42 | 42 | */ |
43 | - protected function __construct(array $headers = array()){ |
|
43 | + protected function __construct(array $headers = array()) { |
|
44 | 44 | |
45 | - if(count($headers) === 0 ) return; |
|
45 | + if (count($headers) === 0) return; |
|
46 | 46 | |
47 | 47 | $alg = @$headers[JSONWebKeyParameters::Algorithm]; |
48 | 48 | $this->setAlgorithm($alg); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function setId($kid) |
86 | 86 | { |
87 | - if(!empty($kid)) |
|
87 | + if (!empty($kid)) |
|
88 | 88 | $this->set[JSONWebKeyParameters::KeyId] = new JsonValue($kid); |
89 | 89 | return $this; |
90 | 90 | } |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function setAlgorithm($alg) |
98 | 98 | { |
99 | - if(!in_array($alg, JSONWebSignatureAndEncryptionAlgorithms::$header_location_alg)) |
|
100 | - throw new InvalidJWKAlgorithm (sprintf('alg %s', $alg)); |
|
99 | + if (!in_array($alg, JSONWebSignatureAndEncryptionAlgorithms::$header_location_alg)) |
|
100 | + throw new InvalidJWKAlgorithm(sprintf('alg %s', $alg)); |
|
101 | 101 | |
102 | 102 | $this->set[JSONWebKeyParameters::Algorithm] = new StringOrURI($alg); |
103 | 103 | return $this; |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function setKeyUse($use) |
112 | 112 | { |
113 | - if(empty($use)) return $this; |
|
114 | - if(!in_array($use, JSONWebKeyPublicKeyUseValues::$valid_uses)) |
|
113 | + if (empty($use)) return $this; |
|
114 | + if (!in_array($use, JSONWebKeyPublicKeyUseValues::$valid_uses)) |
|
115 | 115 | throw new InvalidJWKUseException(sprintf('use %s', $use)); |
116 | 116 | |
117 | 117 | $this->set[JSONWebKeyParameters::PublicKeyUse] = new StringOrURI($use); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function setType($type) |
127 | 127 | { |
128 | - if(!in_array($type, JSONWebKeyTypes::$valid_keys_set)) |
|
128 | + if (!in_array($type, JSONWebKeyTypes::$valid_keys_set)) |
|
129 | 129 | throw new InvalidJWKType(sprintf('use %s', $type)); |
130 | 130 | |
131 | 131 | $this->set[JSONWebKeyParameters::KeyType] = new StringOrURI($type); |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * |
25 | 25 | */ |
26 | - const PublicOnly = 1; |
|
26 | + const PublicOnly = 1; |
|
27 | 27 | /** |
28 | 28 | * |
29 | 29 | */ |
30 | - const IncludePrivate = 2; |
|
30 | + const IncludePrivate = 2; |
|
31 | 31 | /** |
32 | 32 | * |
33 | 33 | */ |
@@ -36,5 +36,5 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * @var array |
38 | 38 | */ |
39 | - static public $valid_values = array ( self::IncludePrivate, self::IncludeSymmetric, self::PublicOnly); |
|
39 | + static public $valid_values = array(self::IncludePrivate, self::IncludeSymmetric, self::PublicOnly); |
|
40 | 40 | } |
41 | 41 | \ No newline at end of file |
@@ -29,11 +29,11 @@ |
||
29 | 29 | /** |
30 | 30 | * |
31 | 31 | */ |
32 | - const Signature = 'sig'; |
|
32 | + const Signature = 'sig'; |
|
33 | 33 | /** |
34 | 34 | * |
35 | 35 | */ |
36 | 36 | const Encryption = 'enc'; |
37 | 37 | |
38 | - public static $valid_uses = array ( self::Signature, self::Encryption); |
|
38 | + public static $valid_uses = array(self::Signature, self::Encryption); |
|
39 | 39 | } |
40 | 40 | \ No newline at end of file |
@@ -32,8 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | const Key = 'k'; |
34 | 34 | |
35 | - public static $valid_algorithms_values = array |
|
36 | - ( |
|
35 | + public static $valid_algorithms_values = array( |
|
37 | 36 | JSONWebSignatureAndEncryptionAlgorithms::HS256, |
38 | 37 | JSONWebSignatureAndEncryptionAlgorithms::HS384, |
39 | 38 | JSONWebSignatureAndEncryptionAlgorithms::HS512, |