Skip to content

Instantly share code, notes, and snippets.

@SecureCloud-biz
Created July 12, 2014 23:40
Show Gist options
  • Save SecureCloud-biz/b31c5dc501b3dfd639a3 to your computer and use it in GitHub Desktop.
Save SecureCloud-biz/b31c5dc501b3dfd639a3 to your computer and use it in GitHub Desktop.
Example of chaining using Facebook PHP SDK 4.0.0
<?php
// turn this:
$request = new FacebookRequest( $session, 'GET', '/me' );
$response = $request->execute();
$graphObject = $response->getGraphObject();
// into this:
$graphObject = (new FacebookRequest( $session, 'GET', '/me' ))->execute()->getGraphObject()->asArray();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment