Skip to content

Commit 0642430

Browse files
authored
Merge branch 'master' into use-multiphp-container
2 parents 1b1b2ca + aac52bf commit 0642430

File tree

11 files changed

+35
-10
lines changed

11 files changed

+35
-10
lines changed

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
8+
jobs:
9+
staticanalysis:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: '8.0'
17+
18+
- name: Run Script
19+
run: |
20+
composer global require phpstan/phpstan
21+
for dir in $(find * -type d -name src -not -path 'appengine/*' -not -path '*/vendor/*' -exec dirname {} \;);
22+
do
23+
composer install --working-dir=$dir --ignore-platform-reqs
24+
echo " autoload.php
25+
~/.composer/vendor/bin/phpstan analyse $dir/src --autoload-file=autoload.php
26+
done

asset/src/list_assets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* @param string|array $assetTypes (Optional) Asset types to list for.
2626
* @param int $pageSize (Optional) Size of one result page.
2727
*/
28-
function list_assets(string $projectId, array $assetTypes = [], int $pageSize)
28+
function list_assets(string $projectId, array $assetTypes = [], int $pageSize = null)
2929
{
3030
// Instantiate a client.
3131
$client = new AssetServiceClient();

bigtable/src/create_production_instance.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use Google\Cloud\Bigtable\Admin\V2\Instance;
3131
use Google\Cloud\Bigtable\Admin\V2\Cluster;
3232
use Google\ApiCore\ApiException;
33+
use Exception;
3334

3435
/**
3536
* Create a production Bigtable instance

cloud_sql/mysql/pdo/src/DBInitializer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use PDO;
2323
use PDOException;
2424
use RuntimeException;
25+
use TypeError;
2526

2627
class DBInitializer
2728
{

cloud_sql/postgres/pdo/src/DBInitializer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use PDO;
2323
use PDOException;
2424
use RuntimeException;
25+
use TypeError;
2526

2627
class DBInitializer
2728
{

cloud_sql/sqlserver/pdo/src/DBInitializer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use PDO;
2323
use PDOException;
2424
use RuntimeException;
25+
use TypeError;
2526

2627
class DBInitializer
2728
{

datastore/api/src/functions/concepts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ function transactional_retry(
803803
for ($i = 0; $i < $retries; $i++) {
804804
try {
805805
transfer_funds($datastore, $fromKey, $toKey, 10);
806-
} catch (Google\Cloud\Exception\ConflictException $e) {
806+
} catch (\Google\Cloud\Core\Exception\ConflictException $e) {
807807
// if $i >= $retries, the failure is final
808808
continue;
809809
}

iap/src/make_iap_request.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
*
3434
* @param string $url The Identity-Aware Proxy-protected URL to fetch.
3535
* @param string $clientId The client ID used by Identity-Aware Proxy.
36-
*
37-
* @return The response body.
3836
*/
3937
function make_iap_request($url, $clientId)
4038
{

logging/src/log_entry_functions.php

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

1818
namespace Google\Cloud\Samples\Logging;
1919

20-
use Google\Cloud\Core\Iterator\ItemIterator;
2120
// [START logging_write_log_entry]
2221
// [START logging_list_log_entries]
2322
// [START logging_delete_log]
@@ -52,11 +51,11 @@ function write_log($projectId, $loggerName, $message)
5251
// [END logging_write_log_entry]
5352

5453
// [START logging_list_log_entries]
55-
/** Return an iterator for listing log entries.
54+
/**
55+
* Print the timestamp and entry for the project and logger.
5656
*
5757
* @param string $projectId The Google project ID.
5858
* @param string $loggerName The name of the logger.
59-
* @return ItemIterator
6059
*/
6160
function list_entries($projectId, $loggerName)
6261
{

logging/src/sink_functions.php

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

1818
namespace Google\Cloud\Samples\Logging;
1919

20-
use Google\Cloud\Core\Iterator\ItemIterator;
2120
// [START logging_use]
2221
use Google\Cloud\Logging\LoggingClient;
2322

@@ -62,7 +61,6 @@ function delete_sink($projectId, $sinkName)
6261
* List log sinks.
6362
*
6463
* @param string $projectId
65-
* @return ItemIterator
6664
*/
6765
function list_sinks($projectId)
6866
{

monitoring/src/update_uptime_check.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function update_uptime_checks($projectId, $configName, $newDisplayName = null, $
3939
'projectId' => $projectId,
4040
]);
4141

42-
$uptimeCheck = $uptimeCheckClient->getUptimeCheckConfig($displayName);
42+
$uptimeCheck = $uptimeCheckClient->getUptimeCheckConfig($configName);
4343
$fieldMask = new FieldMask();
4444
if ($newDisplayName) {
4545
$fieldMask->getPaths()[] = 'display_name';

0 commit comments

Comments
 (0)