Skip to content

Commit 72ff6f0

Browse files
chore(bigquery): prefer env var to arguments (#1777)
1 parent b04587b commit 72ff6f0

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

bigquery/stackoverflow/stackoverflow.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,8 @@
3131

3232
# [END bigquery_simple_app_deps]
3333

34-
// get the project ID as the first argument
35-
if (2 != count($argv)) {
36-
die("Usage: php stackoverflow.php YOUR_PROJECT_ID\n");
37-
}
38-
39-
$projectId = $argv[1];
40-
4134
# [START bigquery_simple_app_client]
42-
$bigQuery = new BigQueryClient([
43-
'projectId' => $projectId,
44-
]);
35+
$bigQuery = new BigQueryClient();
4536
# [END bigquery_simple_app_client]
4637
# [START bigquery_simple_app_query]
4738
$query = <<<ENDSQL

bigquery/stackoverflow/test/stackoverflowTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ class stackoverflowTest extends TestCase
2121
{
2222
public function testStackoverflow()
2323
{
24-
global $argv;
25-
if (!$projectId = getenv('GOOGLE_PROJECT_ID')) {
26-
$this->markTestSkipped('GOOGLE_PROJECT_ID must be set.');
27-
}
28-
$argv[1] = $projectId;
29-
3024
// Invoke stackoverflow.php
3125
include __DIR__ . '/../stackoverflow.php';
3226

0 commit comments

Comments
 (0)