Skip to content

Commit

Permalink
removed composer/ca-bundle, pass own Guzzle client if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Dec 23, 2017
1 parent dc8e9fc commit e2f3ede
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
13 changes: 3 additions & 10 deletions Nextras/YoutubeApi/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Nextras\YoutubeApi;

use Composer\CaBundle\CaBundle;
use DateInterval;
use GuzzleHttp\Client;
use Nette;
Expand All @@ -17,7 +16,6 @@
class Reader
{
use Nette\SmartObject;

/** @var string */
const FETCH_URL = 'https://www.googleapis.com/youtube/v3/videos?key=%s&part=snippet,contentDetails&id=%s';

Expand All @@ -32,17 +30,15 @@ public function __construct($apiKey, Client $httpClient = null)
{
$this->apiKey = $apiKey;
if ($httpClient === null) {
$httpClient = new Client([
'verify' => CaBundle::getSystemCaRootBundlePath(),
]);
$httpClient = new Client();
}
$this->httpClient = $httpClient;
}


/**
* Fetches video data by youtube url
* @param string $videoUrl YouTube url
* @param string $videoUrl YouTube url
* @return Video
*/
public function getVideoByUrl($videoUrl)
Expand All @@ -62,10 +58,9 @@ public function getVideoByUrl($videoUrl)
}



/**
* Fetchs video data
* @param string $videoId
* @param string $videoId
* @return Video
*/
public function getVideo($videoId)
Expand All @@ -74,7 +69,6 @@ public function getVideo($videoId)
}



protected function getData($videoId)
{
$url = sprintf(self::FETCH_URL, $this->apiKey, $videoId);
Expand All @@ -90,7 +84,6 @@ protected function getData($videoId)
}



protected function parseData($data, $videoId)
{
$data = Nette\Utils\Json::decode($data);
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"php": ">=5.6",
"nette/utils": "~2.4",
"nette/http": "~2.2",
"composer/ca-bundle": "~1.0",
"guzzlehttp/guzzle": "~6.2"
},
"require-dev": {
Expand Down

0 comments on commit e2f3ede

Please sign in to comment.