Created
July 12, 2014 23:40
-
-
Save SecureCloud-biz/b31c5dc501b3dfd639a3 to your computer and use it in GitHub Desktop.
Example of chaining using Facebook PHP SDK 4.0.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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