Skip to content

Commit bf713ad

Browse files
authored
Merge pull request #295 from jeffswartz/fix-phpdoc
Fix phpdoc
2 parents a8a1674 + d5553cd commit bf713ad

File tree

11 files changed

+106
-98
lines changed

11 files changed

+106
-98
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ phpunit.xml
77
sample/*/vendor/
88
sample/*/cache/
99
composer.lock
10+
11+
docs/
12+
.phpdoc/
13+
phpDocumentor*
14+
.phpunit.result.cache

DEVELOPING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ This project's tests are written as PHPUnit test cases. Common tasks:
2020

2121
* `./vendor/bin/phing test` - run the test suite.
2222

23+
### Building docs
24+
25+
Install [PhpDocumentor](https://docs.phpdoc.org/). Add it to the project root directory.
26+
Then run `php phpDocumentor.phar --config phpdoc.dist.xml`.
27+
28+
The current reference docs were built with PhpDocumentor 3.3.0.
29+
2330
### Releasing
2431

2532
In order to create a release, the following should be completed in order.

README.md

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ $opentok->signal($sessionId, $signalPayload);
427427
For more information, see the [OpenTok signaling developer
428428
guide](https://tokbox.com/developer/guides/signaling/).
429429

430-
## Working with SIP Interconnect
430+
### Working with SIP Interconnect
431431

432432
You can add an audio-only stream from an external third-party SIP gateway using the SIP
433433
Interconnect feature. This requires a SIP URI, the session ID you wish to add the audio-only
@@ -457,59 +457,6 @@ $opentok->dial($sessionId, $token, $sipUri, $options);
457457
For more information, see the [OpenTok SIP Interconnect developer
458458
guide](https://tokbox.com/developer/guides/sip/).
459459

460-
## Force Disconnect
461-
462-
Your application server can disconnect a client from an OpenTok session by calling the `forceDisconnect($sessionId, $connectionId)`
463-
method of the `OpenTok\OpenTok` class.
464-
465-
```php
466-
use OpenTok\OpenTok;
467-
468-
// Force disconnect a client connection
469-
$opentok->forceDisconnect($sessionId, $connectionId);
470-
```
471-
472-
## Sending Signals
473-
474-
Once a Session is created, you can send signals to everyone in the session or to a specific connection.
475-
You can send a signal by calling the `signal($sessionId, $payload, $connectionId)` method of the
476-
`OpenTok\OpenTok` class.
477-
478-
The `$sessionId` parameter is the session ID of the session.
479-
480-
The `$payload` parameter is an associative array used to set the
481-
following:
482-
483-
- `data` (string) -- The data string for the signal. You can send a maximum of 8kB.
484-
485-
- `type` (string) -- — (Optional) The type string for the signal. You can send a maximum of 128 characters, and only the following characters are allowed: A-Z, a-z, numbers (0-9), '-', '\_', and '~'.
486-
487-
The `$connectionId` parameter is an optional string used to specify the connection ID of
488-
a client connected to the session. If you specify this value, the signal is sent to
489-
the specified client. Otherwise, the signal is sent to all clients connected to the session.
490-
491-
```php
492-
use OpenTok\OpenTok;
493-
494-
// Send a signal to a specific client
495-
$signalPayload = array(
496-
'data' => 'some signal message',
497-
'type' => 'signal type'
498-
);
499-
$connectionId = 'da9cb410-e29b-4c2d-ab9e-fe65bf83fcaf';
500-
$opentok->signal($sessionId, $signalPayload, $connectionId);
501-
502-
// Send a signal to everyone in the session
503-
$signalPayload = array(
504-
'data' => 'some signal message',
505-
'type' => 'signal type'
506-
);
507-
$opentok->signal($sessionId, $signalPayload);
508-
```
509-
510-
For more information, see the [OpenTok signaling developer
511-
guide](https://tokbox.com/developer/guides/signaling/).
512-
513460
## Samples
514461

515462
There are three sample applications included in this repository. To get going as fast as possible, clone the whole

phpdoc.dist.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<phpdocumentor
3+
configVersion="3"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns="https://www.phpdoc.org"
6+
xsi:noNamespaceSchemaLocation="https://docs.phpdoc.org/latest/phpdoc.xsd"
7+
>
8+
<paths>
9+
<output>docs</output>
10+
</paths>
11+
<version number="latest">
12+
<api>
13+
<source dsn=".">
14+
<path>src</path>
15+
</source>
16+
<ignore hidden="true" symlinks="true">
17+
<path>src/OpenTok/Util</path>
18+
</ignore>
19+
</api>
20+
</version>
21+
</phpdocumentor>

src/OpenTok/Archive.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function toJson()
218218

219219
/**
220220
* Adds a stream to a currently running archive that was started with the
221-
* the <code>streamMode</code> set to <code>StreamMode.Manual</code>. You can call the method
221+
* the streamMode set to StreamMode.Manual. You can call the method
222222
* repeatedly with the same stream ID, to toggle the stream's audio or video in the archive.
223223
*
224224
* @param String $streamId The stream ID.
@@ -253,7 +253,7 @@ public function addStreamToArchive(string $streamId, bool $hasAudio, bool $hasVi
253253

254254
/**
255255
* Removes a stream from a currently running archive that was started with the
256-
* the <code>streamMode</code> set to <code>StreamMode.Manual</code>.
256+
* the streamMode set to StreamMode.Manual.
257257
*
258258
* @param String $streamId The stream ID.
259259
*

src/OpenTok/ArchiveList.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public function totalCount()
6767

6868
/**
6969
* Returns an array of Archive objects.
70+
*
71+
* @return Archive[]
7072
*/
7173
public function getItems()
7274
{

src/OpenTok/Broadcast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function updateLayout($layout)
165165

166166
/**
167167
* Adds a stream to a currently running broadcast that was started with the
168-
* the <code>streamMode</code> set to <code>StreamMode.Manual</code>. You can call the method
168+
* the streamMode set to StreamMode.Manual. You can call the method
169169
* repeatedly with the same stream ID, to toggle the stream's audio or video in the broadcast.
170170
*
171171
* @param String $streamId The stream ID.
@@ -200,7 +200,7 @@ public function addStreamToBroadcast(string $streamId, bool $hasAudio, bool $has
200200

201201
/**
202202
* Removes a stream from a currently running broadcast that was started with the
203-
* the <code>streamMode</code> set to <code>StreamMode.Manual</code>.
203+
* the streamMode set to StreamMode.Manual.
204204
*
205205
* @param String $streamId The stream ID.
206206
*

src/OpenTok/OpenTok.php

Lines changed: 53 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ public function __construct($apiKey, $apiSecret, $options = array())
6161
}
6262

6363
/**
64-
* Creates a token for connecting to an OpenTok session. In order to authenticate a user
64+
* Creates a token for connecting to an OpenTok session.
65+
*
66+
* In order to authenticate a user
6567
* connecting to an OpenTok session, the client passes a token when connecting to the session.
6668
* <p>
6769
* For testing, you generate tokens or by logging in to your
@@ -168,23 +170,23 @@ public function generateToken($sessionId, $options = array())
168170
* will use to situate the session in its global network. If you do not set a location hint,
169171
* the OpenTok servers will be based on the first client connecting to the session.</li>
170172
*
171-
* <li><code>'mediaMode'</code> (MediaMode) &mdash; Whether the session will transmit
172-
* streams using the OpenTok Media Router (<code>MediaMode.ROUTED</code>) or not
173-
* (<code>MediaMode.RELAYED</code>). By default, the <code>mediaMode</code> property
174-
* is set to <code>MediaMode.RELAYED</code>.
173+
* <li><code>'mediaMode'</code> (MediaMode) &mdash; Whether the session will transmit
174+
* streams using the OpenTok Media Router (<code>MediaMode.ROUTED</code>) or not
175+
* (<code>MediaMode.RELAYED</code>). By default, the <code>mediaMode</code> property
176+
* is set to <code>MediaMode.RELAYED</code>.
175177
*
176-
* <p>
177-
* With the <code>mediaMode</code> parameter set to <code>MediaMode.RELAYED</code>, the
178-
* session will attempt to transmit streams directly between clients. If clients cannot
179-
* connect due to firewall restrictions, the session uses the OpenTok TURN server to relay
180-
* audio-video streams.
178+
* <p>
179+
* With the <code>mediaMode</code> parameter set to <code>MediaMode.RELAYED</code>, the
180+
* session will attempt to transmit streams directly between clients. If clients cannot
181+
* connect due to firewall restrictions, the session uses the OpenTok TURN server to relay
182+
* audio-video streams.
181183
*
182-
* <p>
183-
* The
184-
* <a href="https://tokbox.com/opentok/tutorials/create-session/#media-mode" target="_top">
185-
* OpenTok Media Router</a> provides the following benefits:
184+
* <p>
185+
* The
186+
* <a href="https://tokbox.com/opentok/tutorials/create-session/#media-mode" target="_top">
187+
* OpenTok Media Router</a> provides the following benefits:
186188
*
187-
* <ul>
189+
* <ul>
188190
* <li>The OpenTok Media Router can decrease bandwidth usage in multiparty sessions.
189191
* (When the <code>mediaMode</code> parameter is set to <code>MediaMode.ROUTED</code>,
190192
* each client must send a separate audio-video stream to each client subscribing to
@@ -197,7 +199,7 @@ public function generateToken($sessionId, $options = array())
197199
* <li>The OpenTok Media Router supports the
198200
* <a href="https://tokbox.com/opentok/tutorials/archiving" target="_top">archiving</a>
199201
* feature, which lets you record, save, and retrieve OpenTok sessions.</li>
200-
* </ul>
202+
* </ul>
201203
*
202204
* </ul>
203205
*
@@ -304,7 +306,7 @@ public function createSession($options = array())
304306
* archive are recorded to a single file (<code>OutputMode::COMPOSED</code>, the default)
305307
* or to individual files (<code>OutputMode::INDIVIDUAL</code>).</li>
306308
*
307-
* <ul>
309+
* </ul>
308310
*
309311
* @return Archive The Archive object, which includes properties defining the archive, including
310312
* the archive ID.
@@ -415,7 +417,9 @@ public function deleteArchive($archiveId)
415417
}
416418

417419
/**
418-
* Returns an ArchiveList. The <code>items()</code> method of this object returns a list of
420+
* Returns a list of archives for a session.
421+
*
422+
* The <code>items()</code> method of this object returns a list of
419423
* archives that are completed and in-progress, for your API key.
420424
*
421425
* @param integer $offset Optional. The index offset of the first archive. 0 is offset of the
@@ -453,7 +457,9 @@ public function setArchiveLayout(string $archiveId, Layout $layoutType): void
453457
}
454458

455459
/**
456-
* Sets the layout class list for streams in a session. Layout classes are used in
460+
* Sets the layout class list for streams in a session.
461+
*
462+
* Layout classes are used in
457463
* the layout for composed archives and live streaming broadcasts. For more information, see
458464
* <a href="https://tokbox.com/developer/guides/archiving/layout-control.html">Customizing
459465
* the video layout for composed archives</a> and
@@ -496,7 +502,9 @@ public function forceDisconnect($sessionId, $connectionId)
496502
* Force the publisher of a specific stream to mute its published audio.
497503
*
498504
* <p>
499-
* Also see the <a href="#method_forceMuteAll">OpenTok->forceMuteAll()</a> method.
505+
* Also see the
506+
* <a href="classes/OpenTok-OpenTok.html#method_forceMuteAll">OpenTok->forceMuteAll()</a>
507+
* method.
500508
*
501509
* @param string $sessionId The OpenTok session ID containing the stream.
502510
*
@@ -525,10 +533,12 @@ public function forceMuteStream(string $sessionId, string $streamId): bool
525533
* <p>
526534
* In addition to existing streams, any streams that are published after the call to
527535
* this method are published with audio muted. You can remove the mute state of a session
528-
* by calling the <a href="#method_disableForceMute">OpenTok->disableForceMute()</a> method.
529-
*
536+
* <a href="classes/OpenTok-OpenTok.html#method_disableForceMute">OpenTok->disableForceMute()</a>
537+
* method.
530538
* <p>
531-
* Also see the <a href="#method_forceMuteStream">OpenTok->forceMuteStream()</a> method.
539+
* Also see the
540+
* <a href="classes/OpenTok-OpenTok.html#method_forceMuteStream">OpenTok->forceMuteStream()</a>
541+
* method.
532542
*
533543
* @param string $sessionId The OpenTok session ID.
534544
*
@@ -564,7 +574,8 @@ public function forceMuteAll(string $sessionId, array $options): bool
564574
* published to the session will no longer have audio muted.
565575
*
566576
* <p>
567-
* After you call the <a href="#method_forceMuteAll">OpenTok->forceMuteAll()</a> method,
577+
* After you call the
578+
* <a href="classes/OpenTok-OpenTok.html#method_forceMuteAll">OpenTok->forceMuteAll()</a> method
568579
* any streams published after the call are published with audio muted. Call the
569580
* <c>disableForceMute()</c> method to remove the mute state of a session, so that
570581
* new published streams are not automatically muted.
@@ -603,8 +614,9 @@ public function disableForceMute(string $sessionId, array $options): bool
603614
*
604615
* @param String $sessionId The session ID of the session to be broadcast.
605616
*
606-
* @param Array $options (Optional) An array with options for the broadcast. This array has
617+
* @param array $options (Optional) An array with options for the broadcast. This array has
607618
* the following properties:
619+
*
608620
* <ul>
609621
* <li><code>layout</code> (Layout) &mdash; (Optional) An object defining the initial
610622
* layout type of the broadcast. If you do not specify an initial layout type,
@@ -713,7 +725,9 @@ public function updateBroadcastLayout(string $broadcastId, Layout $layout): void
713725
}
714726

715727
/**
716-
* Sets the layout class list for a stream. Layout classes are used in
728+
* Sets the layout class list for a stream.
729+
*
730+
* Layout classes are used in
717731
* the layout for composed archives and live streaming broadcasts.
718732
* <p>
719733
* For more information, see
@@ -725,7 +739,8 @@ public function updateBroadcastLayout(string $broadcastId, Layout $layout): void
725739
* <p>
726740
* You can set the initial layout class list for streams published by a client when you generate
727741
* the token used by the client to connect to the session. See the
728-
* <a href="#method_generateToken">OpenTok->generateToken()</a> method.
742+
* <a href="classes/OpenTok-OpenTok.html#method_generateToken">OpenTok::generateToken()</a>
743+
* method.
729744
*
730745
* @param string $sessionId The session ID of the session the stream belongs to.
731746
*
@@ -812,8 +827,8 @@ public function listStreams($sessionId)
812827
* @param string $token The OpenTok token to be used for the participant being called.
813828
* You can add token data to identify that the participant is on a SIP endpoint or for
814829
* other identifying data, such as phone numbers. Generate a token using the
815-
* <a href="#method_generateToken">OpenTok->generateToken()</a> or
816-
* <a href="OpenTok.Session.html#method_generateToken">Session->generateToken()</a>
830+
* <a href="classes/OpenTok-OpenTok.html#method_generateToken">OpenTok::generateToken()</a> or
831+
* <a href="classes/OpenTok-Session.html#method_generateToken">Session::generateToken()</a>
817832
* method.
818833
*
819834
* @param string $sipUri The SIP URI to be used as destination of the SIP Call initiated from
@@ -839,16 +854,16 @@ public function listStreams($sessionId)
839854
* INVITE request for HTTP Digest authentication in case this is required by the Third Party
840855
* SIP Platform.
841856
*
842-
* <ul>
857+
* <ul>
843858
*
844-
* <li><code>'username'</code> (string) &mdash; The username to be used
845-
* in the the SIP INVITE​ request for HTTP digest authentication (if one
846-
* is required).</li>
859+
* <li><code>'username'</code> (string) &mdash; The username to be used
860+
* in the the SIP INVITE​ request for HTTP digest authentication (if one
861+
* is required).</li>
847862
*
848-
* <li><code>'password'</code> (string) &mdash; The password to be used
849-
* in the the SIP INVITE​ request for HTTP digest authentication.</li>
863+
* <li><code>'password'</code> (string) &mdash; The password to be used
864+
* in the the SIP INVITE​ request for HTTP digest authentication.</li>
850865
*
851-
* </ul>
866+
* </ul>
852867
*
853868
* <li><code>'secure'</code> (Boolean) &mdash; Indicates whether the media
854869
* must be transmitted encrypted (true, the default) or not (false).</li>
@@ -869,7 +884,8 @@ public function listStreams($sessionId)
869884
* @return SipCall An object contains the OpenTok connection ID and stream ID
870885
* for the SIP call's connection in the OpenTok session. You can use the connection ID
871886
* to terminate the SIP call, using the
872-
* <a href="#method_forceDisconnect">OpenTok->forceDisconnect()</a> method.
887+
* <a href="classes/OpenTok-OpenTok.html#method_forceDisconnect">OpenTok::method_forceDisconnect()</a>
888+
* method.
873889
*/
874890
public function dial($sessionId, $token, $sipUri, $options = [])
875891
{

src/OpenTok/Role.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ abstract class Role extends BasicEnum
2222
/**
2323
* In addition to the privileges granted to a publisher, a moderator can perform
2424
* moderation functions, such as forcing clients to disconnect, to stop publishing streams,
25-
* or to mute audio in published streams. See the
25+
* or to mute audio in published streams.
26+
*
27+
* See the
2628
* <a href="https://tokbox.com/developer/guides/moderation/">Moderation developer guide</a>.
2729
*/
2830
const MODERATOR = 'moderator';

0 commit comments

Comments
 (0)