Skip to content

Commit c3d4921

Browse files
committed
Consistent whitespace/indentation/codestyle
1 parent c4cd34f commit c3d4921

File tree

13 files changed

+305
-297
lines changed

13 files changed

+305
-297
lines changed

sample/Archiving/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ is sent to the <http://localhost:8080/stop/:archiveId> URL where `:archiveId` re
9898
client receives in the 'archiveStarted' event. The route handler for this request is shown below:
9999

100100
```php
101-
$app->get('/stop/:archiveId', function($archiveId) use ($app) {
101+
$app->get('/stop/:archiveId', function ($archiveId) use ($app) {
102102
$archive = $app->opentok->stopArchive($archiveId);
103103
$app->response->headers->set('Content-Type', 'application/json');
104104
echo $archive->toJson();
@@ -168,7 +168,7 @@ $app->get('/history', function () use ($app) {
168168

169169
$archives = $app->opentok->listArchives($offset, 5);
170170

171-
$toArray = function($archive) {
171+
$toArray = function ($archive) {
172172
return $archive->toArray();
173173
};
174174

@@ -214,7 +214,7 @@ from the URL. Lastly, we send a redirect response back to the browser so the dow
214214
The code for the delete route handler is shown below:
215215

216216
```php
217-
$app->get('/delete/:archiveId', function($archiveId) use ($app) {
217+
$app->get('/delete/:archiveId', function ($archiveId) use ($app) {
218218
$app->opentok->deleteArchive($archiveId);
219219
$app->redirect('/history');
220220
});

sample/Archiving/web/index.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
));
3434

3535
// Intialize a cache, store it in the app container
36-
$app->container->singleton('cache', function() {
36+
$app->container->singleton('cache', function () {
3737
return new Cache;
3838
});
3939

@@ -45,7 +45,7 @@
4545
$app->apiKey = getenv('API_KEY');
4646

4747
// If a sessionId has already been created, retrieve it from the cache
48-
$sessionId = $app->cache->getOrCreate('sessionId', array(), function() use ($app) {
48+
$sessionId = $app->cache->getOrCreate('sessionId', array(), function () use ($app) {
4949
// If the sessionId hasn't been created, create it now and store it
5050
$session = $app->opentok->createSession(array(
5151
'mediaMode' => MediaMode::ROUTED
@@ -94,7 +94,7 @@
9494

9595
$archives = $app->opentok->listArchives($offset, 5);
9696

97-
$toArray = function($archive) {
97+
$toArray = function ($archive) {
9898
return $archive->toArray();
9999
};
100100

@@ -123,13 +123,13 @@
123123
echo $archive->toJson();
124124
});
125125

126-
$app->get('/stop/:archiveId', function($archiveId) use ($app) {
126+
$app->get('/stop/:archiveId', function ($archiveId) use ($app) {
127127
$archive = $app->opentok->stopArchive($archiveId);
128128
$app->response->headers->set('Content-Type', 'application/json');
129129
echo $archive->toJson();
130130
});
131131

132-
$app->get('/delete/:archiveId', function($archiveId) use ($app) {
132+
$app->get('/delete/:archiveId', function ($archiveId) use ($app) {
133133
$app->opentok->deleteArchive($archiveId);
134134
$app->redirect('/history');
135135
});

sample/HelloWorld/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ stored in the cache for later use.
8080

8181
```php
8282
// If a sessionId has already been created, retrieve it from the cache
83-
$sessionId = $app->cache->getOrCreate('sessionId', array(), function() use ($app) {
83+
$sessionId = $app->cache->getOrCreate('sessionId', array(), function () use ($app) {
8484
// If the sessionId hasn't been created, create it now and store it
8585
$session = $app->opentok->createSession();
8686
return $session->getSessionId();

sample/HelloWorld/web/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
));
3030

3131
// Intialize a cache, store it in the app container
32-
$app->container->singleton('cache', function() {
32+
$app->container->singleton('cache', function () {
3333
return new Cache;
3434
});
3535

@@ -44,7 +44,7 @@
4444
$app->get('/', function () use ($app) {
4545

4646
// If a sessionId has already been created, retrieve it from the cache
47-
$sessionId = $app->cache->getOrCreate('sessionId', array(), function() use ($app) {
47+
$sessionId = $app->cache->getOrCreate('sessionId', array(), function () use ($app) {
4848
// If the sessionId hasn't been created, create it now and store it
4949
$session = $app->opentok->createSession();
5050
return $session->getSessionId();

sample/SipCall/web/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
));
3535

3636
// Intialize a cache, store it in the app container
37-
$app->container->singleton('cache', function() {
37+
$app->container->singleton('cache', function () {
3838
return new Cache;
3939
});
4040

@@ -56,7 +56,7 @@
5656
// Configure routes
5757
$app->get('/', function () use ($app) {
5858
// If a sessionId has already been created, retrieve it from the cache
59-
$sessionId = $app->cache->getOrCreate('sessionId', array(), function() use ($app) {
59+
$sessionId = $app->cache->getOrCreate('sessionId', array(), function () use ($app) {
6060
// If the sessionId hasn't been created, create it now and store it
6161
$session = $app->opentok->createSession(array('mediaMode' => MediaMode::ROUTED));
6262
return $session->getSessionId();

src/OpenTok/Broadcast.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class Broadcast {
1515
private $isStopped = false;
1616
private $client;
1717

18-
public function __construct($broadcastData, $options = array()) {
18+
public function __construct($broadcastData, $options = array())
19+
{
1920
// unpack optional arguments (merging with default values) into named variables
2021
$defaults = array(
2122
'apiKey' => null,

src/OpenTok/Layout.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ private function __construct($type, $stylesheet = null)
7979
$this->stylesheet = $stylesheet;
8080
}
8181

82-
public function jsonSerialize() {
82+
public function jsonSerialize()
83+
{
8384
$data = array(
8485
'type' => $this->type
8586
);

src/OpenTok/OpenTok.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct($apiKey, $apiSecret, $options = array())
5151

5252
$this->client = isset($client) ? $client : new Client();
5353
if (!$this->client->isConfigured()) {
54-
$this->client->configure($apiKey, $apiSecret, $apiUrl);
54+
$this->client->configure($apiKey, $apiSecret, $apiUrl);
5555
}
5656
$this->apiKey = $apiKey;
5757
$this->apiSecret = $apiSecret;
@@ -284,7 +284,7 @@ public function startArchive($sessionId, $options=array())
284284
{
285285
// support for deprecated method signature, remove in v3.0.0 (not before)
286286
if (!is_array($options)) {
287-
$options = array('name' => $options);
287+
$options = array('name' => $options);
288288
}
289289

290290
// unpack optional arguments (merging with default values) into named variables

src/OpenTok/Util/BasicEnum.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
abstract class BasicEnum {
99
private static $constCacheArray = null;
1010

11-
private static function getConstants() {
11+
private static function getConstants()
12+
{
1213
if (self::$constCacheArray === null) self::$constCacheArray = array();
1314

1415
$calledClass = get_called_class();
@@ -20,7 +21,8 @@ private static function getConstants() {
2021
return self::$constCacheArray[$calledClass];
2122
}
2223

23-
public static function isValidName($name, $strict = false) {
24+
public static function isValidName($name, $strict = false)
25+
{
2426
$constants = self::getConstants();
2527

2628
if ($strict) {
@@ -31,7 +33,8 @@ public static function isValidName($name, $strict = false) {
3133
return in_array(strtolower($name), $keys);
3234
}
3335

34-
public static function isValidValue($value) {
36+
public static function isValidValue($value)
37+
{
3538
$values = array_values(self::getConstants());
3639
return in_array($value, $values, $strict = true);
3740
}

src/OpenTok/Util/Client.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public function configure($apiKey, $apiSecret, $apiUrl, $options = array())
4848
$this->apiSecret = $apiSecret;
4949

5050
if (empty($options['handler'])) {
51-
$handlerStack = HandlerStack::create();
51+
$handlerStack = HandlerStack::create();
5252
} else {
53-
$handlerStack = $options['handler'];
53+
$handlerStack = $options['handler'];
5454
}
5555

5656
$handler = Middleware::mapRequest(function (RequestInterface $request) {
@@ -71,7 +71,8 @@ public function configure($apiKey, $apiSecret, $apiUrl, $options = array())
7171
$this->configured = true;
7272
}
7373

74-
public function isConfigured() {
74+
public function isConfigured()
75+
{
7576
return $this->configured;
7677
}
7778

@@ -232,10 +233,10 @@ public function listArchives($offset, $count)
232233
$request = new Request('GET', '/v2/project/'.$this->apiKey.'/archive');
233234
$queryParams = [];
234235
if ($offset != 0) {
235-
$queryParams['offset'] = $offset;
236+
$queryParams['offset'] = $offset;
236237
}
237238
if (!empty($count)) {
238-
$queryParams['count'] = $count;
239+
$queryParams['count'] = $count;
239240
}
240241
try {
241242
$response = $this->client->send($request, [
@@ -320,8 +321,8 @@ public function getLayout($resourceId, $resourceType = 'broadcast')
320321
public function updateLayout($resourceId, $layout, $resourceType = 'broadcast')
321322
{
322323
$request = new Request(
323-
'PUT',
324-
'/v2/project/'.$this->apiKey.'/'.$resourceType.'/'.$resourceId.'/layout'
324+
'PUT',
325+
'/v2/project/'.$this->apiKey.'/'.$resourceType.'/'.$resourceId.'/layout'
325326
);
326327
try {
327328
$response = $this->client->send($request, [
@@ -355,12 +356,12 @@ public function updateStream($sessionId, $streamId, $properties)
355356
public function dial($sessionId, $token, $sipUri, $options)
356357
{
357358
$body = array(
358-
'sessionId' => $sessionId,
359-
'token' => $token,
360-
'sip' => array(
361-
'uri' => $sipUri,
362-
'secure' => $options['secure']
363-
)
359+
'sessionId' => $sessionId,
360+
'token' => $token,
361+
'sip' => array(
362+
'uri' => $sipUri,
363+
'secure' => $options['secure']
364+
)
364365
);
365366

366367
if (isset($options) && array_key_exists('headers', $options) && sizeof($options['headers']) > 0) {

0 commit comments

Comments
 (0)