Comments (4)
I've tried with the following PHP code (based on docs examples):
$client = new Github\Client();
$gists = $client->api('gists');
$paginator = new Github\ResultPager( $client );
$parameters = array('Github'); //Username
$result = $paginator->fetchAll($gists, 'gists', $parameters);
And I have this error message:
Warning: call_user_func_array() expects parameter 1 to be a valid
callback, class 'Github\Api\Gists' does not have a method 'gists' in
/XXXX/lib/Github/ResultPager.php on line 74 Fatal error: Call to a
member function getPagination() on a non-object in
/XXXXX/lib/Github/ResultPager.php on line 92
What's wrong with my code, please?
from php-github-api.
OK, for those who wants to play with Gists, you can use Guzzle (https://github.com/guzzle/guzzle) as framework and use official functions from Github API. Now I have pagination with my Gists!
from php-github-api.
@A973C I am trying the same thing and I am hitting the same error. Would you mind sharing your working code , please..
Thanks
from php-github-api.
For anyone with the same question, the answer is you should call all
in the $paginator
, not gists
as in the OP:
$client = new Github\Client();
$gists = $client->api('gists');
$per_page = 5;
$paginator = new Github\ResultPager($client, $per_page);
// first page
$result = $paginator->fetch($gists, 'all');
// next page
$result = $paginator->fetchNext();
from php-github-api.
Related Issues (20)
- Repo documentation out-of-date? HOT 4
- Secrets Scanning Alerts HOT 1
- Sync a fork branch with the upstream repository
- Document the use of authenticate() using ENV variable HOT 4
- Suggestion to remove authorizations::create from doc HOT 2
- ResultPager::get() can return string HOT 4
- Add .phpstorm.meta.php to improve code completion HOT 1
- Add support for new github api versioning
- Env API
- Correct Async usage
- projects returning empty. HOT 1
- api('issue')->find() is still documented but was removed
- Http\Client\HttpClient Deprecation HOT 2
- GraphQL queries are not cached
- Allow php-http/cache-plugin version 2 HOT 6
- pull request closing references HOT 1
- reactions
- Get owner's repositorie's activity
- Update `Apps` to accept query parameters as per specification
- Cannnot Remove an Issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-github-api.