Syntax-highlighted doc examples

This commit is contained in:
Barnaby Walters 2021-06-13 00:30:44 +02:00
parent d0fa39472a
commit b53d5fc1da
2 changed files with 24 additions and 22 deletions

View File

@ -90,7 +90,7 @@
<aside class="phpdocumentor-element-found-in"> <aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr> <abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr>
: :
<span class="phpdocumentor-element-found-in__line">43</span> <span class="phpdocumentor-element-found-in__line">45</span>
</aside> </aside>
<p class="phpdocumentor-summary">Single User Password Authentication Callback</p> <p class="phpdocumentor-summary">Single User Password Authentication Callback</p>
@ -104,7 +104,7 @@ for bootstrapping and testing purposes.</p>
<p>The sign-in form can be customised by making your own template and passing the path to <p>The sign-in form can be customised by making your own template and passing the path to
the constructor.</p> the constructor.</p>
<p>Minimal usage:</p> <p>Minimal usage:</p>
<pre class="prettyprint"><code class="prettyprint">// One-off during app configuration: <pre class="prettyprint"><code class="language-php">// One-off during app configuration:
YOUR_HASHED_PASSWORD = password_hash('my super strong password', PASSWORD_DEFAULT); YOUR_HASHED_PASSWORD = password_hash('my super strong password', PASSWORD_DEFAULT);
// In your app: // In your app:
@ -202,7 +202,7 @@ $server = new IndieAuth\Server([
<aside class="phpdocumentor-element-found-in"> <aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr> <abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr>
: :
<span class="phpdocumentor-element-found-in__line">44</span> <span class="phpdocumentor-element-found-in__line">46</span>
</aside> </aside>
@ -242,7 +242,7 @@ $server = new IndieAuth\Server([
<aside class="phpdocumentor-element-found-in"> <aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr> <abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr>
: :
<span class="phpdocumentor-element-found-in__line">46</span> <span class="phpdocumentor-element-found-in__line">48</span>
</aside> </aside>
@ -272,7 +272,7 @@ $server = new IndieAuth\Server([
<aside class="phpdocumentor-element-found-in"> <aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr> <abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr>
: :
<span class="phpdocumentor-element-found-in__line">47</span> <span class="phpdocumentor-element-found-in__line">49</span>
</aside> </aside>
@ -302,7 +302,7 @@ $server = new IndieAuth\Server([
<aside class="phpdocumentor-element-found-in"> <aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr> <abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr>
: :
<span class="phpdocumentor-element-found-in__line">49</span> <span class="phpdocumentor-element-found-in__line">51</span>
</aside> </aside>
@ -332,7 +332,7 @@ $server = new IndieAuth\Server([
<aside class="phpdocumentor-element-found-in"> <aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr> <abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr>
: :
<span class="phpdocumentor-element-found-in__line">48</span> <span class="phpdocumentor-element-found-in__line">50</span>
</aside> </aside>
@ -366,7 +366,7 @@ $server = new IndieAuth\Server([
<aside class="phpdocumentor-element-found-in"> <aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr> <abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr>
: :
<span class="phpdocumentor-element-found-in__line">59</span> <span class="phpdocumentor-element-found-in__line">61</span>
</aside> </aside>
<p class="phpdocumentor-summary">Constructor</p> <p class="phpdocumentor-summary">Constructor</p>
@ -439,7 +439,7 @@ $server = new IndieAuth\Server([
<aside class="phpdocumentor-element-found-in"> <aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr> <abbr class="phpdocumentor-element-found-in__file" title="src/Callback/SingleUserPasswordAuthenticationCallback.php"><a href="files/src-callback-singleuserpasswordauthenticationcallback.html"><abbr title="src/Callback/SingleUserPasswordAuthenticationCallback.php">SingleUserPasswordAuthenticationCallback.php</abbr></a></abbr>
: :
<span class="phpdocumentor-element-found-in__line">69</span> <span class="phpdocumentor-element-found-in__line">71</span>
</aside> </aside>

View File

@ -24,19 +24,21 @@ use function Taproot\IndieAuth\renderTemplate;
* *
* Minimal usage: * Minimal usage:
* *
* // One-off during app configuration: * ```php
* YOUR_HASHED_PASSWORD = password_hash('my super strong password', PASSWORD_DEFAULT); * // One-off during app configuration:
* * YOUR_HASHED_PASSWORD = password_hash('my super strong password', PASSWORD_DEFAULT);
* // In your app: *
* use Taproot\IndieAuth; * // In your app:
* $server = new IndieAuth\Server([ * use Taproot\IndieAuth;
* * $server = new IndieAuth\Server([
* 'authenticationHandler' => new IndieAuth\Callback\SingleUserPasswordAuthenticationCallback( *
* ['me' => 'https://me.example.com/'], * 'authenticationHandler' => new IndieAuth\Callback\SingleUserPasswordAuthenticationCallback(
* YOUR_HASHED_PASSWORD * ['me' => 'https://me.example.com/'],
* ) * YOUR_HASHED_PASSWORD
* * )
* ]); *
* ]);
* ```
* *
* See documentation for `__construct()` for information about customising behaviour. * See documentation for `__construct()` for information about customising behaviour.
*/ */