More namespace refactoring

This commit is contained in:
Timothy Warren 2015-09-15 13:19:29 -04:00
parent b1c6039630
commit 9193938dee
32 changed files with 61 additions and 64 deletions

View File

@ -17,7 +17,7 @@ require _dir(SRC_DIR, '/functions.php');
// -----------------------------------------------------------------------------
// Setup DI container
// -----------------------------------------------------------------------------
$container = new Base\Container();
$container = new Container();
// -----------------------------------------------------------------------------
// Setup error handling
@ -42,7 +42,7 @@ $container->set('error-handler', $defaultHandler);
// -----------------------------------------------------------------------------
// Create Config Object
$config = new Base\Config();
$config = new Config();
$container->set('config', $config);
// Create Aura Router Object
@ -64,9 +64,9 @@ $container->set('response', $web_factory->newResponse());
// -----------------------------------------------------------------------------
// Router
// -----------------------------------------------------------------------------
$container->set('url-generator', new Base\UrlGenerator($container));
$container->set('url-generator', new UrlGenerator($container));
$router = new Base\Router($container);
$router = new Router($container);
$router->dispatch();
// End of bootstrap.php

View File

@ -12,6 +12,5 @@
</transformations>
<files>
<directory>src</directory>
<ignore>src/views/*</ignore>
</files>
</phpdoc>

View File

@ -5,18 +5,16 @@
bootstrap="tests/bootstrap.php">
<filter>
<whitelist>
<directory suffix=".php">src/Base</directory>
<directory suffix=".php">src/Controller</directory>
<directory suffix=".php">src/Model</directory>
<directory suffix=".php">src/Aviat</directory>
</whitelist>
</filter>
<testsuites>
<testsuite name="BaseTests">
<directory>tests</directory>
<directory>tests/Base</directory>
<testsuite name="Ion">
<directory>tests/Ion</directory>
</testsuite>
<testsuite name="AnimeClient">
<directory>tests/AnimeClient</directory>
</testsuite>
<testsuite name="ModelTests"><directory>tests/Model</directory></testsuite>
<testsuite name="ControllerTests"><directory>tests/Controller</directory></testsuite>
</testsuites>
<php>
<server name="HTTP_USER_AGENT" value="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0" />

View File

@ -3,7 +3,7 @@
* Base Configuration class
*/
namespace Aviat\AnimeClient\Base;
namespace Aviat\AnimeClient;
/**
* Wrapper for configuration values

View File

@ -1,6 +1,6 @@
<?php
namespace Aviat\AnimeClient\Base;
namespace Aviat\AnimeClient;
/**
* Dependency container

View File

@ -2,7 +2,7 @@
/**
* Base Controller
*/
namespace Aviat\AnimeClient\Base;
namespace Aviat\AnimeClient;
/**
* Base class for controllers, defines output methods

View File

@ -5,9 +5,9 @@
namespace Aviat\AnimeClient\Controller;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Base\Controller as BaseController;
use Aviat\AnimeClient\Base\Config;
use Aviat\AnimeClient\Container;
use Aviat\AnimeClient\Controller as BaseController;
use Aviat\AnimeClient\Config;
use Aviat\AnimeClient\Model\Anime as AnimeModel;
use Aviat\AnimeClient\Model\AnimeCollection as AnimeCollectionModel;

View File

@ -5,9 +5,9 @@
namespace Aviat\AnimeClient\Controller;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Base\Controller as BaseController;
use Aviat\AnimeClient\Base\Config;
use Aviat\AnimeClient\Container;
use Aviat\AnimeClient\Controller as BaseController;
use Aviat\AnimeClient\Config;
use Aviat\AnimeClient\Model\Anime as AnimeModel;
use Aviat\AnimeClient\Model\AnimeCollection as AnimeCollectionModel;

View File

@ -4,9 +4,9 @@
*/
namespace Aviat\AnimeClient\Controller;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Base\Controller;
use Aviat\AnimeClient\Base\Config;
use Aviat\AnimeClient\Container;
use Aviat\AnimeClient\Controller;
use Aviat\AnimeClient\Config;
use Aviat\AnimeClient\Model\Manga as MangaModel;
/**

View File

@ -2,8 +2,8 @@
namespace Aviat\AnimeClient\Controller;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Base\Controller;
use Aviat\AnimeClient\Container;
use Aviat\AnimeClient\Controller;
class Stats extends Controller {

View File

@ -2,7 +2,7 @@
/**
* Base for base models
*/
namespace Aviat\AnimeClient\Base;
namespace Aviat\AnimeClient;
use abeautifulsite\SimpleImage;

View File

@ -2,16 +2,16 @@
/**
* Base API Model
*/
namespace Aviat\AnimeClient\Base\Model;
namespace Aviat\AnimeClient\Model;
use \GuzzleHttp\Client;
use \GuzzleHttp\Cookie\CookieJar;
use \Aviat\AnimeClient\Base\Container;
use \Aviat\AnimeClient\Container;
/**
* Base model for api interaction
*/
class API extends \Aviat\AnimeClient\Base\Model {
class API extends \Aviat\AnimeClient\Model {
/**
* Base url for making api requests

View File

@ -5,7 +5,7 @@
namespace Aviat\AnimeClient\Model;
use Aviat\AnimeClient\Base\Model\API;
use Aviat\AnimeClient\Model\API;
/**
* Model for handling requests dealing with the anime list

View File

@ -5,8 +5,8 @@
namespace Aviat\AnimeClient\Model;
use Aviat\AnimeClient\Base\Model\DB;
use \Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Model\DB;
use Aviat\AnimeClient\Container;
use Aviat\AnimeClient\Model\Anime as AnimeModel;
/**

View File

@ -2,14 +2,14 @@
/**
* Base DB model
*/
namespace Aviat\AnimeClient\Base\Model;
namespace Aviat\AnimeClient\Model;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Container;
/**
* Base model for database interaction
*/
class DB extends \Aviat\AnimeClient\Base\Model {
class DB extends \Aviat\AnimeClient\Model {
/**
* The query builder object
* @var object $db

View File

@ -4,7 +4,7 @@
*/
namespace Aviat\AnimeClient\Model;
use Aviat\AnimeClient\Base\Model\API;
use Aviat\AnimeClient\Model\API;
/**
* Model for handling requests dealing with the manga list

View File

@ -5,8 +5,8 @@
namespace Aviat\AnimeClient\Model;
use Aviat\AnimeClient\Base\Model\DB;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Model\DB;
use Aviat\AnimeClient\Container;
use StatsChartsTrait;

View File

@ -2,7 +2,7 @@
/**
* Routing logic
*/
namespace Aviat\AnimeClient\Base;
namespace Aviat\AnimeClient;
use Aura\Web\Request;
use Aura\Web\Response;

View File

@ -3,7 +3,7 @@
* Base class for routing to make namespaced config settings
* easier to work with
*/
namespace Aviat\AnimeClient\Base;
namespace Aviat\AnimeClient;
/**
* Base for routing/url classes

View File

@ -2,7 +2,7 @@
/**
* Generate full urls from fragments
*/
namespace Aviat\AnimeClient\Base;
namespace Aviat\AnimeClient;
/**
* UrlGenerator class.

View File

@ -1,7 +1,7 @@
<?php
use Aviat\AnimeClient\Base\Model as BaseModel;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Model as BaseModel;
use Aviat\AnimeClient\Container;
class BaseModelTest extends AnimeClient_TestCase {

View File

@ -1,6 +1,6 @@
<?php
use \Aviat\AnimeClient\Base\Config;
use \Aviat\AnimeClient\Config;
class ConfigTest extends AnimeClient_TestCase {

View File

@ -1,9 +1,9 @@
<?php
use \Aviat\AnimeClient\Base\Controller;
use \Aviat\AnimeClient\Controller;
use \Aura\Web\WebFactory;
use \Aura\Router\RouterFactory;
class BaseControllerTest extends AnimeClient_TestCase {
class ControllerTest extends AnimeClient_TestCase {
public function setUp()
{

View File

@ -1,7 +1,7 @@
<?php
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Base\Model\API as BaseApiModel;
use Aviat\AnimeClient\Container;
use Aviat\AnimeClient\Model\API as BaseApiModel;
class MockBaseApiModel extends BaseApiModel {
@ -23,8 +23,8 @@ class BaseApiModelTest extends AnimeClient_TestCase {
$baseApiModel = new MockBaseApiModel($this->container);
// Some basic type checks for class memebers
$this->assertInstanceOf('\Aviat\AnimeClient\Base\Model', $baseApiModel);
$this->assertInstanceOf('\Aviat\AnimeClient\Base\Model\API', $baseApiModel);
$this->assertInstanceOf('\Aviat\AnimeClient\Model', $baseApiModel);
$this->assertInstanceOf('\Aviat\AnimeClient\Model\API', $baseApiModel);
$this->assertInstanceOf('\GuzzleHttp\Client', $baseApiModel->client);
$this->assertInstanceOf('\GuzzleHttp\Cookie\CookieJar', $baseApiModel->cookieJar);

View File

@ -1,6 +1,6 @@
<?php
use Aviat\AnimeClient\Base\Model\DB as BaseDBModel;
use Aviat\AnimeClient\Model\DB as BaseDBModel;
class BaseDBModelTest extends AnimeClient_TestCase {

View File

@ -1,9 +1,9 @@
<?php
use Aviat\AnimeClient\Base\Router;
use Aviat\AnimeClient\Base\Config;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Base\UrlGenerator;
use Aviat\AnimeClient\Router;
use Aviat\AnimeClient\Config;
use Aviat\AnimeClient\Container;
use Aviat\AnimeClient\UrlGenerator;
use Aura\Web\WebFactory;
use Aura\Router\RouterFactory;

View File

@ -1,8 +1,8 @@
<?php
use Aviat\AnimeClient\Base\Config;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Base\UrlGenerator;
use Aviat\AnimeClient\Config;
use Aviat\AnimeClient\Container;
use Aviat\AnimeClient\UrlGenerator;
class UrlGeneratorTest extends AnimeClient_TestCase {

View File

@ -3,8 +3,8 @@
* Global setup for unit tests
*/
use Aviat\AnimeClient\Base\Config;
use Aviat\AnimeClient\Base\Container;
use Aviat\AnimeClient\Config;
use Aviat\AnimeClient\Container;
// -----------------------------------------------------------------------------
// Mock the default error handler