aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/php/greeter_client.php
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanleycheung@google.com>2016-05-19 16:47:52 -0700
committerGravatar Stanley Cheung <stanleycheung@google.com>2016-05-19 16:47:52 -0700
commit46d94bb4aac9f075008229afe815d58072b8baea (patch)
tree24d120599e3df73fa4d155fc31fb272effc480e7 /examples/php/greeter_client.php
parentd55ddbcbe34f69d7971908c148b8a24fb95f04f8 (diff)
php: fix examples/ directory as well
Diffstat (limited to 'examples/php/greeter_client.php')
-rw-r--r--examples/php/greeter_client.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/examples/php/greeter_client.php b/examples/php/greeter_client.php
index 718ef88c64..a5c0865393 100644
--- a/examples/php/greeter_client.php
+++ b/examples/php/greeter_client.php
@@ -32,19 +32,21 @@
*
*/
-require dirname(__FILE__) . '/vendor/autoload.php';
-require dirname(__FILE__) . '/helloworld.php';
+require dirname(__FILE__).'/vendor/autoload.php';
+require dirname(__FILE__).'/helloworld.php';
-function greet($name) {
- $client = new helloworld\GreeterClient('localhost:50051', [
- 'credentials' => Grpc\ChannelCredentials::createInsecure()
- ]);
- $request = new helloworld\HelloRequest();
- $request->setName($name);
- list($reply, $status) = $client->SayHello($request)->wait();
- $message = $reply->getMessage();
- return $message;
+function greet($name)
+{
+ $client = new helloworld\GreeterClient('localhost:50051', [
+ 'credentials' => Grpc\ChannelCredentials::createInsecure(),
+ ]);
+ $request = new helloworld\HelloRequest();
+ $request->setName($name);
+ list($reply, $status) = $client->SayHello($request)->wait();
+ $message = $reply->getMessage();
+
+ return $message;
}
$name = !empty($argv[1]) ? $argv[1] : 'world';
-print(greet($name)."\n");
+echo greet($name)."\n";