Skip to content

Commit cef8f21

Browse files
authored
bug #1 Update docs to match implementation (iangregory)
This PR was squashed before being merged into the 1.0-dev branch. Discussion ---------- Corrects a couple of inconsistencies between the docs/comments and the code Commits ------- ca5f4d4 Update README.md to match implementation 8566f85 Correct usage example in comments
2 parents 9a00c25 + 8566f85 commit cef8f21

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ $splitTokenFactory = new Argon2SplitTokenFactory();
7373

7474
// Step 1. Create a new SplitToken for usage
7575

76-
$token = $splitTokenFactory->create();
76+
$token = $splitTokenFactory->generate();
7777

7878
// The $authToken holds a \ParagonIE\HiddenString\HiddenString to prevent
7979
// leakage of this value. You need to cast this object to an actual string
@@ -90,7 +90,7 @@ $authToken = $token->token(); // Returns a \ParagonIE\HiddenString\HiddenString
9090
// Indicate when the token must expire. Note that you need to clear the token from storage yourself.
9191
// Pass null (or leave this method call absent) to never expire the token (not recommended).
9292
//
93-
$authToken->expiresAt(new \DateTimeImmutable('+1 hour'));
93+
$authToken->expireAt(new \DateTimeImmutable('+1 hour'));
9494

9595
// Now to store the token cast the SplitToken to a SplitTokenValueHolder object.
9696
//

src/SplitToken.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* // Create
5151
* $splitTokenFactory = ...;
5252
*
53-
* $token = $splitTokenFactory->create();
53+
* $token = $splitTokenFactory->generate();
5454
*
5555
* // The $authToken is to be shared with the receiver (eg. the user) only.
5656
* // And is URI safe.

0 commit comments

Comments
 (0)