Skip to content

Commit fa90d48

Browse files
authored
Fix signUrl readme and cs (GoogleCloudPlatform#869)
1 parent 6e39ec9 commit fa90d48

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

cdn/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ The provided file includes implementation of base64url encode and decode functio
55

66
## Usage
77

8-
```
9-
10-
require_once 'signUrl.php';
11-
$base64url_key = 'wpLL7f4VB9RNe_WI0BBGmA=='; // head -c 16 /dev/urandom | base64 | tr +/ -_
12-
$signed_url = signUrl('https://example.com/foo', 'my-key', $base64url_key, time() + 1800);
13-
echo $signed_url;
14-
?>
8+
```php
9+
require_once 'signUrl.php';
10+
$base64url_key = 'wpLL7f4VB9RNe_WI0BBGmA=='; // head -c 16 /dev/urandom | base64 | tr +/ -_
11+
$signed_url = signUrl('https://example.com/foo', 'my-key', $base64url_key, time() + 1800);
12+
echo $signed_url;
1513
```

cdn/test/signUrlTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use PHPUnit\Framework\TestCase;
1919

20-
require_once __DIR__."/../signUrl.php";
20+
require_once __DIR__ . "/../signUrl.php";
2121

2222
class signUrlTest extends TestCase
2323
{
@@ -54,8 +54,7 @@ public function testSignUrl()
5454
"https://www.example.com/some/path?some=query&another=param&Expires=1549751461&KeyName=my-key&Signature=sTqqGX5hUJmlRJ84koAIhWW_c3M="),
5555
);
5656

57-
foreach($cases as $c)
58-
{
57+
foreach ($cases as $c) {
5958
$this->assertEquals(sign_url($c[0], $c[1], $encoded_key, $c[2]), $c[3]);
6059
}
6160
}

0 commit comments

Comments
 (0)