facebook/php-sdk — Issue #509: Auto-doc support lost on $fb=new Facebook()
Author: uuf6429
Created: 2011-12-12 08:25:10+00:00
State: open

For some strange reason, some IDEs like PHPStorm do not seem to like that Facebook class is extending BaseFacebook, with the result that IDE suggestions on using `$fb` do not contain methods from `BaseFacebook`.
As a quick fix, we are using the following "hack" instead of plain initializing an object.

/**
* @param $config array of 'appId' and 'secret'
* @return BaseFacebook
*/
function Facebook($config){
return new Facebook($config);
}

Usage:

Replace `$fb=new Facebook($cfg);` with `$fb=Facebook($cfg);`