PHP code example of leo108 / php_sdk_skeleton

1. Go to this page and download the library: Download leo108/php_sdk_skeleton library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

leo108 / php_sdk_skeleton example snippets


class RepositoryApi extends Leo108\SDK\AbstractApi {
    protected function getFullApiUrl($api)
    {
        return 'https://api.github.com/'.$api;
    }
}

class RepositoryApi extends Leo108\SDK\AbstractApi {
    public function list($username)
    {
        return $this->apiGet('users/'.$username.'/repos');
    }
}

class GithubSDK extends Leo108\SDK\SDK {
    protected function getApiMap()
    {
        return [
            'repository' => RepositoryApi::class,
        ];
    }
}