Skip to content

Commit

Permalink
Regenerate example code
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed May 1, 2018
1 parent f72e593 commit cd306a3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion example/generated/Twitch/Twirp/Example/Haberdasher.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Generated by the protocol buffer compiler (protoc-gen-twirp_php master). DO NOT EDIT!
# source: service.proto

namespace Twitch\Twirp\Example;
Expand Down
4 changes: 2 additions & 2 deletions example/generated/Twitch/Twirp/Example/HaberdasherClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Generated by the protocol buffer compiler (protoc-gen-twirp_php master). DO NOT EDIT!
# source: service.proto

namespace Twitch\Twirp\Example;
Expand Down Expand Up @@ -51,7 +51,7 @@ public function MakeHat(array $ctx, \Twitch\Twirp\Example\Size $in)

$out = new \Twitch\Twirp\Example\Hat();

$url = (string)$this->addr->withPath('/twirp/twitch.twirp.example.Haberdasher/MakeHat');
$url = $this->addr.'/twirp/twitch.twirp.example.Haberdasher/MakeHat';

$this->doProtobufRequest($ctx, $url, $in, $out);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Generated by the protocol buffer compiler (protoc-gen-twirp_php master). DO NOT EDIT!
# source: service.proto

namespace Twitch\Twirp\Example;
Expand Down
2 changes: 1 addition & 1 deletion example/generated/Twitch/Twirp/Example/Server.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Generated by the protocol buffer compiler (protoc-gen-twirp_php master). DO NOT EDIT!

namespace Twitch\Twirp\Example;

Expand Down
16 changes: 11 additions & 5 deletions example/generated/Twitch/Twirp/Example/TwirpClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Generated by the protocol buffer compiler (protoc-gen-twirp_php master). DO NOT EDIT!

namespace Twitch\Twirp\Example;

Expand Down Expand Up @@ -267,12 +267,18 @@ final private function isHttpRedirect($status)
*/
final protected function urlBase($addr)
{
$url = $this->messageFactory->createRequest('POST', $addr)->getUri();
$scheme = parse_url($addr, PHP_URL_SCHEME);

if ($url->getScheme() == '') {
$url = $url->withScheme('http');
// If parse_url fails, return the addr unchanged.
if ($scheme === false) {
return $addr;
}

return $url;
// If the addr does not specify a scheme, default to http.
if (empty($scheme)) {
$addr = 'http://'.ltrim($addr, ':/');
}

return $addr;
}
}
2 changes: 1 addition & 1 deletion example/generated/Twitch/Twirp/Example/TwirpError.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Generated by the protocol buffer compiler (protoc-gen-twirp_php master). DO NOT EDIT!

namespace Twitch\Twirp\Example;

Expand Down
2 changes: 1 addition & 1 deletion example/generated/Twitch/Twirp/Example/TwirpServer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Generated by the protocol buffer compiler (protoc-gen-twirp_php master). DO NOT EDIT!

namespace Twitch\Twirp\Example;

Expand Down

0 comments on commit cd306a3

Please sign in to comment.