Skip to content

Commit 02a481a

Browse files
committed
remote __toString
1 parent 981506b commit 02a481a

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/Key.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ public function __construct($keyMaterial, $algorithm)
2828
$this->algorithm = $algorithm;
2929
}
3030

31-
public function __toString()
32-
{
33-
return $this->keyMaterial;
34-
}
35-
3631
/**
3732
* Return the algorithm valid for this key
3833
*
@@ -44,7 +39,7 @@ public function getAlgorithm()
4439
}
4540

4641
/**
47-
* @return string
42+
* @return string|resource
4843
*/
4944
public function getKeyMaterial()
5045
{

tests/JWTTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function testArrayAccessKIDChooser()
218218
'1' => new Key('my_key', 'HS256'),
219219
'2' => new Key('my_key2', 'HS256'),
220220
));
221-
$msg = JWT::encode('abc', $keys['1'], 'HS256', '1');
221+
$msg = JWT::encode('abc', $keys['1']->getKeyMaterial(), 'HS256', '1');
222222
$decoded = JWT::decode($msg, $keys);
223223
$this->assertEquals($decoded, 'abc');
224224
}

0 commit comments

Comments
 (0)