<?php require_once __DIR__ . '/../../vendor/autoload.php'; use Linkorb\AnswersClient\Client; use Linkorb\AnswersClient\Answer; // get the client $client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992'); $answer = new Answer($client); $answer->get(57); try { $answer->delete(); } catch (Exception $e) { echo $e->getMessage(); }
<?php require_once __DIR__ . '/../../vendor/autoload.php'; use Linkorb\AnswersClient\Client; use Linkorb\AnswersClient\Answer; // get the client $client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992'); $answer = new Answer($client); $answer->get(59); try { $answer->comment('this is some comment'); } catch (Exception $e) { echo $e->getMessage(); }
<?php require_once __DIR__ . '/../../vendor/autoload.php'; use Linkorb\AnswersClient\Client; use Linkorb\AnswersClient\Answer; // get the client $client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992'); $answer = new Answer($client); $answer->get(58); $comments = $answer->getComments(); var_dump($comments); $votes = $answer->getVotes(); var_dump($votes);
<?php require_once __DIR__ . '/../../vendor/autoload.php'; use Linkorb\AnswersClient\Client; use Linkorb\AnswersClient\Answer; // get the client $client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992'); $answer = new Answer($client); $answer->get(16); try { $answer->vote(); } catch (Exception $e) { echo $e->getMessage(); }