| @@ -2,11 +2,9 @@ discard block | ||
| 2 | 2 | |
| 3 | 3 | namespace LibLynx\Connect; | 
| 4 | 4 | |
| 5 | +use GuzzleHttp\Client as GuzzleClient; | |
| 5 | 6 | use GuzzleHttp\Exception\RequestException; | 
| 6 | -use kamermans\OAuth2\GrantType\ClientCredentials; | |
| 7 | -use kamermans\OAuth2\OAuth2Middleware; | |
| 8 | 7 | use GuzzleHttp\HandlerStack; | 
| 9 | -use GuzzleHttp\Client as GuzzleClient; | |
| 10 | 8 | use Kevinrob\GuzzleCache\CacheMiddleware; | 
| 11 | 9 | use Kevinrob\GuzzleCache\Storage\Psr16CacheStorage; | 
| 12 | 10 | use Kevinrob\GuzzleCache\Strategy\PrivateCacheStrategy; | 
| @@ -15,6 +13,8 @@ discard block | ||
| 15 | 13 | use Psr\Log\LoggerInterface; | 
| 16 | 14 | use Psr\Log\NullLogger; | 
| 17 | 15 | use Psr\SimpleCache\CacheInterface; | 
| 16 | +use kamermans\OAuth2\GrantType\ClientCredentials; | |
| 17 | +use kamermans\OAuth2\OAuth2Middleware; | |
| 18 | 18 | |
| 19 | 19 | /** | 
| 20 | 20 | * LibLynx Connect API client | 
| @@ -111,7 +111,7 @@ discard block | ||
| 111 | 111 | } | 
| 112 | 112 | |
| 113 | 113 | /** | 
| 114 | - * @return array containing client id and secret | |
| 114 | + * @return string[] containing client id and secret | |
| 115 | 115 | */ | 
| 116 | 116 | public function getCredentials() | 
| 117 | 117 |      { | 
| @@ -181,6 +181,9 @@ discard block | ||
| 181 | 181 |          return $this->makeAPIRequest('GET', $entrypoint); | 
| 182 | 182 | } | 
| 183 | 183 | |
| 184 | + /** | |
| 185 | + * @param string $entrypoint | |
| 186 | + */ | |
| 184 | 187 | public function post($entrypoint, $json) | 
| 185 | 188 |      { | 
| 186 | 189 |          return $this->makeAPIRequest('POST', $entrypoint, $json); | 
| @@ -191,6 +194,9 @@ discard block | ||
| 191 | 194 |          return $this->makeAPIRequest('PUT', $entrypoint, $json); | 
| 192 | 195 | } | 
| 193 | 196 | |
| 197 | + /** | |
| 198 | + * @param string $method | |
| 199 | + */ | |
| 194 | 200 | protected function makeAPIRequest($method, $entrypoint, $json = null) | 
| 195 | 201 |      { | 
| 196 | 202 |          $this->log->debug('{method} {entrypoint} {json}', [ | 
| @@ -25,6 +25,9 @@ | ||
| 25 | 25 |          throw new \RuntimeException("No value called $name"); | 
| 26 | 26 | } | 
| 27 | 27 | |
| 28 | + /** | |
| 29 | + * @param string $name | |
| 30 | + */ | |
| 28 | 31 | public function getLink($name) | 
| 29 | 32 |      { | 
| 30 | 33 |          if (isset($this->_links->$name)) { |