worldia / textmaster-api

Simple PHP client for the Textmaster API
1 stars 5 forks source link

Add PagerResult #14

Closed Pitoune closed 8 years ago

cdaguerre commented 8 years ago

@pitoune Could you take a look at the Scrutinizer issues?

Pitoune commented 8 years ago

@cdaguerre According to Scrutinizer I should type hint $pagination (https://github.com/cdaguerre/php-textmaster-api/blob/feat.result.pager/lib/Textmaster/ResultPager.php#L11) as mixed because it is what call_user_func_array returns. What do you think ?

cdaguerre commented 8 years ago

You can force Scrutinizer to recognise it as an array by adding a phpdoc block above:

/** @var array $this->pagination */
$this->pagination = call_user_func_array(array($api, $method), $parameters);

Not sure if the above works, but I'd like to find out. However this will work:

/** @var array $pagination */
$pagination = call_user_func_array(array($api, $method), $parameters);
$this->pagination = $pagination;
Pitoune commented 8 years ago

@cdaguerre First solution was not working but it is OK with the second one.

cdaguerre commented 8 years ago

Same thing here, could you squash your commits into one, eg. Added ResultPager