Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
style:
name: PHP Style Check
uses: GoogleCloudPlatform/php-tools/.github/workflows/code-standards.yml@main
with:
path: src

static-analysis:
name: PHPStan Static Analysis
uses: GoogleCloudPlatform/php-tools/.github/workflows/static-analysis.yml@main
10 changes: 0 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,3 @@ jobs:
command: composer update ${{ matrix.composerflags }}
- name: Run script
run: vendor/bin/phpunit

style:
name: PHP Style Check
uses: GoogleCloudPlatform/php-tools/.github/workflows/code-standards.yml@main
with:
path: src

static-analysis:
name: PHPStan Static Analysis
uses: GoogleCloudPlatform/php-tools/.github/workflows/static-analysis.yml@main
2 changes: 1 addition & 1 deletion src/GapicClientTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ private function startApiCall(
Message $request = null,
array $optionalArgs = []
) {
$methodDescriptors =$this->validateCallConfig($methodName);
$methodDescriptors = $this->validateCallConfig($methodName);
$callType = $methodDescriptors['callType'];

// Prepare request-based headers, merge with user-provided headers,
Expand Down
2 changes: 1 addition & 1 deletion src/Testing/MockClientStreamingCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function wait()
public function write($request, array $options = [])
{
if ($this->waitCalled) {
throw new ApiException('Cannot call write() after wait()', Code::INTERNAL, ApiStatus::INTERNAL);
throw new ApiException('Cannot call write() after wait()', Code::INTERNAL, ApiStatus::INTERNAL);
}
if (is_a($request, '\Google\Protobuf\Internal\Message')) {
/** @var Message $newRequest */
Expand Down
2 changes: 1 addition & 1 deletion src/Transport/GrpcFallbackTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private function unpackResponse(Call $call, ResponseInterface $response)
$decodeType = $call->getDecodeType();
/** @var Message $responseMessage */
$responseMessage = new $decodeType();
$responseMessage->mergeFromString((string)$response->getBody());
$responseMessage->mergeFromString((string) $response->getBody());
return $responseMessage;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Transport/Rest/JsonStreamDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private function _decode()
if ($b === '}' && !$str) {
$level--;
if ($level === 1) {
$end = $cursor+1;
$end = $cursor + 1;
}
}
// Track the closing of an array if not in a string value.
Expand Down Expand Up @@ -195,7 +195,7 @@ private function _decode()

// Dump the part of the chunk used for parsing the message
// and use the remaining for the next message.
$remaining = $chunkLength-$length;
$remaining = $chunkLength - $length;
$chunk = substr($chunk, $end, $remaining);

// Reset all indices and exit chunk processing.
Expand Down