{"id":20446958,"url":"https://github.com/socialconnect/common","last_synced_at":"2025-04-13T01:06:28.836Z","repository":{"id":19563236,"uuid":"22812272","full_name":"SocialConnect/common","owner":"SocialConnect","description":"[READ-ONLY] Subtree split of the SocialConnect Common Component","archived":false,"fork":false,"pushed_at":"2020-06-09T10:01:51.000Z","size":127,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T01:05:50.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://socialconnect.lowl.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SocialConnect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-10T15:45:06.000Z","updated_at":"2020-06-09T10:01:04.000Z","dependencies_parsed_at":"2022-08-24T05:21:25.811Z","dependency_job_id":null,"html_url":"https://github.com/SocialConnect/common","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialConnect%2Fcommon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialConnect%2Fcommon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialConnect%2Fcommon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialConnect%2Fcommon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SocialConnect","download_url":"https://codeload.github.com/SocialConnect/common/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650508,"owners_count":21139678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T10:23:52.194Z","updated_at":"2025-04-13T01:06:28.795Z","avatar_url":"https://github.com/SocialConnect.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Common Component\n================\n\n## Build `Client` for your REST application\n\n```php\nuse SocialConnect\\Common\\ClientAbstract;\n\nclass MySocialNetworkClient extends ClientAbstract\n{\n  public function requestMethod($method, $parameters)\n  {\n    //...\n  }\n  \n  public function getUser($id)\n  {\n    $result = $this-\u003erequestMethod('/user/get/', $id);\n    if ($result) {\n      $user = new User();\n      $user-\u003eid = $result-\u003eid;\n      //...\n      \n      return $user;\n    }\n    \n    return false;\n  }\n}\n```\n\nNext you can use it\n\n```php\n$client = new MySocialNetworkClient($appId, $appSecret);\n// You can use any client that implements Psr\\Http\\Client\\ClientInterface\n$client-\u003esetHttpClient(new \\SocialConnect\\HttpClient\\Curl());\n\n$user = $client-\u003egetUser(1);\n\n//Custom rest methods\n$client-\u003erequestMethod('myTestMethod', []);\n$client-\u003erequestMethod('myTest', []);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialconnect%2Fcommon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocialconnect%2Fcommon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialconnect%2Fcommon/lists"}