[Fix] Static Method callback
Hi guys, I've found a bug while trying to use a static method (custom callback) for formatting my axis values.
Those two valid callbacks (based on PHP standards for callbacks) fails on [pDraw.class.php ~ ln 3133, is_function function]:
Code:
...
$pData->setAxisDisplay(0, AXIS_FORMAT_CUSTOM, 'class::method');
...
and
Code:
...
$pData->setAxisDisplay(0, AXIS_FORMAT_CUSTOM, array('class', 'method'));
...
(Both are valid callbacks!)
I fixed it by changing (on pDraw.class.php ~ ln 3133):
Code:
...
if(function_exists($Format)) {
...
for:
Code:
...
if(is_callable($Format)) {
...
As is_callable is available since PHP 4 >= 4.0.6, I think we will not have problems with Backward Compatibility. It's also the recommended way to check for valid and compatible callbacks those times....
Then, every instance method, static method or simple function can be used.
Maybe it could be added to the next minor...
Oh, and Jean, thanks for the awesome library!