Provider/SoundCloudProvider.php 1 location
|
@@ 82-95 (lines=14) @@
|
79 |
|
* @return mixed |
80 |
|
* @throws \Exception |
81 |
|
*/ |
82 |
|
protected function getDataByReference($reference) |
83 |
|
{ |
84 |
|
$this->disableErrorHandler(); |
85 |
|
$data = json_decode(file_get_contents(sprintf(self::URL_OEMBED, $reference)), true); |
86 |
|
$this->restoreErrorHandler(); |
87 |
|
|
88 |
|
if (empty($data['title'])) { |
89 |
|
throw new \Exception( |
90 |
|
sprintf('Could not get data from SoundCloud for id "%s", is the name correct?', $reference) |
91 |
|
); |
92 |
|
} |
93 |
|
|
94 |
|
return $data; |
95 |
|
} |
96 |
|
|
97 |
|
/** |
98 |
|
* @param $value |
Provider/YouTubeProvider.php 1 location
|
@@ 97-108 (lines=12) @@
|
94 |
|
* @return mixed |
95 |
|
* @throws \Exception |
96 |
|
*/ |
97 |
|
protected function getDataByYouTubeId($id) |
98 |
|
{ |
99 |
|
$this->disableErrorHandler(); |
100 |
|
$data = json_decode(file_get_contents(sprintf(self::URL_OEMBED, $id)), true); |
101 |
|
$this->restoreErrorHandler(); |
102 |
|
|
103 |
|
if (empty($data['title'])) { |
104 |
|
throw new \Exception(sprintf('Could not get data from YouTube for id "%s", is the id correct?', $id)); |
105 |
|
} |
106 |
|
|
107 |
|
return $data; |
108 |
|
} |
109 |
|
|
110 |
|
/** |
111 |
|
* @param $value |