refactor: Move exceptions and streams to seperate namespaces

This commit is contained in:
Pierre Rudloff 2019-04-22 21:06:05 +02:00
parent 1a6ff90eac
commit e13404903b
11 changed files with 24 additions and 14 deletions

View File

@ -5,6 +5,8 @@
namespace Alltube;
use Alltube\Exception\EmptyUrlException;
use Alltube\Exception\PasswordException;
use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Response;
@ -65,6 +67,7 @@ class Video
/**
* URLs of the video files.
*
* @var array
*/
private $urls;

View File

@ -3,7 +3,7 @@
* EmptyUrlException class.
*/
namespace Alltube;
namespace Alltube\Exception;
use Exception;

View File

@ -3,7 +3,7 @@
* PasswordException class.
*/
namespace Alltube;
namespace Alltube\Exception;
use Exception;

View File

@ -3,8 +3,9 @@
* ConvertedPlaylistArchiveStream class.
*/
namespace Alltube;
namespace Alltube\Stream;
use Alltube\Video;
use Slim\Http\Stream;
/**

View File

@ -3,8 +3,9 @@
* PlaylistArchiveStream class.
*/
namespace Alltube;
namespace Alltube\Stream;
use Alltube\Video;
use Barracuda\ArchiveStream\ZipArchive;
use Psr\Http\Message\StreamInterface;

View File

@ -3,7 +3,7 @@
* YoutubeChunkStream class.
*/
namespace Alltube;
namespace Alltube\Stream;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\StreamInterface;
@ -17,6 +17,7 @@ class YoutubeChunkStream implements StreamInterface
/**
* HTTP response containing the video chunk.
*
* @var Response
*/
private $response;
@ -173,7 +174,7 @@ class YoutubeChunkStream implements StreamInterface
}
/**
* Returns the remaining contents in a string
* Returns the remaining contents in a string.
*
* @return string
*/

View File

@ -3,9 +3,11 @@
* YoutubeStream class.
*/
namespace Alltube;
namespace Alltube\Stream;
use Alltube\Video;
use GuzzleHttp\Psr7\AppendStream;
use Psr\Http\Message\StreamInterface;
/**
* Stream that downloads a video in chunks.

View File

@ -79,6 +79,8 @@
"autoload": {
"psr-4": {
"Alltube\\": "classes/",
"Alltube\\Stream\\": "classes/streams/",
"Alltube\\Exception\\": "classes/exceptions/",
"Alltube\\Controller\\": "controllers/",
"Alltube\\Test\\": "tests/"
}

View File

@ -5,12 +5,12 @@
namespace Alltube\Controller;
use Alltube\ConvertedPlaylistArchiveStream;
use Alltube\EmptyUrlException;
use Alltube\PasswordException;
use Alltube\PlaylistArchiveStream;
use Alltube\Stream\ConvertedPlaylistArchiveStream;
use Alltube\Exception\EmptyUrlException;
use Alltube\Exception\PasswordException;
use Alltube\Stream\PlaylistArchiveStream;
use Alltube\Video;
use Alltube\YoutubeStream;
use Alltube\Stream\YoutubeStream;
use Exception;
use Slim\Http\Request;
use Slim\Http\Response;

View File

@ -8,7 +8,7 @@ namespace Alltube\Controller;
use Alltube\Config;
use Alltube\Locale;
use Alltube\LocaleManager;
use Alltube\PasswordException;
use Alltube\Exception\PasswordException;
use Alltube\Video;
use Exception;
use Psr\Container\ContainerInterface;

View File

@ -5,7 +5,7 @@
namespace Alltube\Test;
use Alltube\PlaylistArchiveStream;
use Alltube\Stream\PlaylistArchiveStream;
use Alltube\Video;
/**