I'm working with the Github PHP Library. There is a specific call that you can make that uses the Buzz HTTP Client as shown by the following:
$client->getHttpClient()->get('repos/:user/:repo/events');
The problem is the return of that request is something that I'm unsure how to access the elements:
Github\HttpClient\Message\Response Object
(
[remainingCalls] =>
[protocolVersion:Buzz\Message\Response:private] => 0
[statusCode:Buzz\Message\Response:private] => 200
[reasonPhrase:Buzz\Message\Response:private] => OK
[headers:Buzz\Message\AbstractMessage:private] =>
[content:Buzz\Message\AbstractMessage:private] =>
)
Now I can loop through the object doing something like the following:
foreach( $events as $item ) {
print_r( $item );
}
But I really only care about the content inside of headers
and content
.
Is anyone aware of how I can directly access those elements directly without the need to loop?