diff --git a/src/Magnet.php b/src/Magnet.php deleted file mode 100644 index f90a59a..0000000 --- a/src/Magnet.php +++ /dev/null @@ -1,119 +0,0 @@ - null, - 'xl' => 0, - 'xt' => [], - 'tr' => [], - 'ws' => [], - 'as' => [], - 'xs' => [], - 'kt' => [], - 'mt' => [], - 'so' => [], - 'x.pe' => [], - ]; - - if (!self::is($link)) - { - return false; - } - - $link = urldecode($link); - - $link = str_replace( - [ - 'magnet:', - '?', - 'xt=', - 'tr=', - 'ws=', - 'as=', - 'xs=', - 'mt=', - 'x.pe=', - ], - [ - false, - false, - 'xt[]=', - 'tr[]=', - 'ws[]=', - 'as[]=', - 'xs[]=', - 'mt[]=', - 'x.pe[]=', - ], - $link - ); - - parse_str($link, $attributes); - - switch (true) - { - case empty($attributes['xt']): - case empty($attributes['tr']): - // ... - - return false; - } - - foreach ((array) $attributes as $key => $value) - { - - switch ($key) - { - case 'kt': - - foreach ((array) explode(' ', $value) as $keyword) - { - $result[$key][] = trim($keyword); - } - - break; - default: - - $result[$key] = $value; - } - } - - return (object) $result; - } -} \ No newline at end of file diff --git a/src/Url.php b/src/Url.php index 93b3eff..c4bcfd1 100644 --- a/src/Url.php +++ b/src/Url.php @@ -1,6 +1,6 @@ implode(':', $part), - 'parts' => $part, - ]; - - return (object) $result; - } - - return false; - } -} \ No newline at end of file diff --git a/tests/UrlTest.php b/tests/UrlTest.php index b8117d1..19707f6 100644 --- a/tests/UrlTest.php +++ b/tests/UrlTest.php @@ -1,6 +1,6 @@