Code Duplication    Length = 12-14 lines in 2 locations

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

Provider/SoundCloudProvider.php 1 location

@@ 83-96 (lines=14) @@
80
     * @return mixed
81
     * @throws \Exception
82
     */
83
    protected function getDataByReference($reference)
84
    {
85
        $this->disableErrorHandler();
86
        $data = json_decode(file_get_contents(sprintf(self::URL_OEMBED, $reference)), true);
87
        $this->restoreErrorHandler();
88
89
        if (empty($data['title'])) {
90
            throw new \Exception(
91
                sprintf('Could not get data from SoundCloud for id "%s", is the name correct?', $reference)
92
            );
93
        }
94
95
        return $data;
96
    }
97
98
    /**
99
     * @param $value