Skip to content

Commit 4ec4077

Browse files
Update to v1.36.0
1 parent cf75367 commit 4ec4077

File tree

4 files changed

+72
-17
lines changed

4 files changed

+72
-17
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"keywords": ["rpc"],
66
"homepage": "https://grpc.io",
77
"license": "Apache-2.0",
8-
"version": "1.35.0",
8+
"version": "1.36.0",
99
"require": {
1010
"php": ">=7.0.0"
1111
},

src/lib/BaseStub.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ private function _UnaryUnaryCallFactory($channel)
423423
$method,
424424
$argument,
425425
$deserialize,
426+
$this->_UnaryUnaryCallFactory($channel->getNext()),
426427
$metadata,
427-
$options,
428-
$this->_UnaryUnaryCallFactory($channel->getNext())
428+
$options
429429
);
430430
};
431431
}
@@ -452,9 +452,9 @@ private function _UnaryStreamCallFactory($channel)
452452
$method,
453453
$argument,
454454
$deserialize,
455+
$this->_UnaryStreamCallFactory($channel->getNext()),
455456
$metadata,
456-
$options,
457-
$this->_UnaryStreamCallFactory($channel->getNext())
457+
$options
458458
);
459459
};
460460
}
@@ -479,9 +479,9 @@ private function _StreamUnaryCallFactory($channel)
479479
return $channel->getInterceptor()->interceptStreamUnary(
480480
$method,
481481
$deserialize,
482+
$this->_StreamUnaryCallFactory($channel->getNext()),
482483
$metadata,
483-
$options,
484-
$this->_StreamUnaryCallFactory($channel->getNext())
484+
$options
485485
);
486486
};
487487
}
@@ -506,9 +506,9 @@ private function _StreamStreamCallFactory($channel)
506506
return $channel->getInterceptor()->interceptStreamStream(
507507
$method,
508508
$deserialize,
509+
$this->_StreamStreamCallFactory($channel->getNext()),
509510
$metadata,
510-
$options,
511-
$this->_StreamStreamCallFactory($channel->getNext())
511+
$options
512512
);
513513
};
514514
}

src/lib/Interceptor.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ public function interceptUnaryUnary(
3131
$method,
3232
$argument,
3333
$deserialize,
34+
$continuation,
3435
array $metadata = [],
35-
array $options = [],
36-
$continuation
36+
array $options = []
3737
) {
3838
return $continuation($method, $argument, $deserialize, $metadata, $options);
3939
}
4040

4141
public function interceptStreamUnary(
4242
$method,
4343
$deserialize,
44+
$continuation,
4445
array $metadata = [],
45-
array $options = [],
46-
$continuation
46+
array $options = []
4747
) {
4848
return $continuation($method, $deserialize, $metadata, $options);
4949
}
@@ -52,19 +52,19 @@ public function interceptUnaryStream(
5252
$method,
5353
$argument,
5454
$deserialize,
55+
$continuation,
5556
array $metadata = [],
56-
array $options = [],
57-
$continuation
57+
array $options = []
5858
) {
5959
return $continuation($method, $argument, $deserialize, $metadata, $options);
6060
}
6161

6262
public function interceptStreamStream(
6363
$method,
6464
$deserialize,
65+
$continuation,
6566
array $metadata = [],
66-
array $options = [],
67-
$continuation
67+
array $options = []
6868
) {
6969
return $continuation($method, $deserialize, $metadata, $options);
7070
}

src/lib/Status.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/*
3+
*
4+
* Copyright 2020 gRPC authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
*/
19+
20+
namespace Grpc;
21+
22+
/**
23+
* This is an experimental and incomplete implementation of gRPC server
24+
* for PHP. APIs are _definitely_ going to be changed.
25+
*
26+
* DO NOT USE in production.
27+
*/
28+
29+
/**
30+
* Class Status
31+
* @package Grpc
32+
*/
33+
class Status
34+
{
35+
public static function status(int $code, string $details, array $metadata = null): array
36+
{
37+
$status = [
38+
'code' => $code,
39+
'details' => $details,
40+
];
41+
if ($metadata) {
42+
$status['metadata'] = $metadata;
43+
}
44+
return $status;
45+
}
46+
47+
public static function ok(array $metadata = null): array
48+
{
49+
return Status::status(STATUS_OK, 'OK', $metadata);
50+
}
51+
public static function unimplemented(): array
52+
{
53+
return Status::status(STATUS_UNIMPLEMENTED, 'UNIMPLEMENTED');
54+
}
55+
}

0 commit comments

Comments
 (0)