More namespace refactoring

This commit is contained in:
Timothy Warren 2015-09-15 13:19:29 -04:00
parent 97a5abe665
commit 8a68559f0e
32 changed files with 61 additions and 64 deletions

View File

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

View File

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

View File

@ -5,18 +5,16 @@
bootstrap="tests/bootstrap.php"> bootstrap="tests/bootstrap.php">
<filter> <filter>
<whitelist> <whitelist>
<directory suffix=".php">src/Base</directory> <directory suffix=".php">src/Aviat</directory>
<directory suffix=".php">src/Controller</directory>
<directory suffix=".php">src/Model</directory>
</whitelist> </whitelist>
</filter> </filter>
<testsuites> <testsuites>
<testsuite name="BaseTests"> <testsuite name="Ion">
<directory>tests</directory> <directory>tests/Ion</directory>
<directory>tests/Base</directory> </testsuite>
<testsuite name="AnimeClient">
<directory>tests/AnimeClient</directory>
</testsuite> </testsuite>
<testsuite name="ModelTests"><directory>tests/Model</directory></testsuite>
<testsuite name="ControllerTests"><directory>tests/Controller</directory></testsuite>
</testsuites> </testsuites>
<php> <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" /> <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 * Base Configuration class
*/ */
namespace Aviat\AnimeClient\Base; namespace Aviat\AnimeClient;
/** /**
* Wrapper for configuration values * Wrapper for configuration values

View File

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

View File

@ -2,7 +2,7 @@
/** /**
* Base Controller * Base Controller
*/ */
namespace Aviat\AnimeClient\Base; namespace Aviat\AnimeClient;
/** /**
* Base class for controllers, defines output methods * Base class for controllers, defines output methods
@ -289,4 +289,4 @@ class Controller {
echo $this->response->content->get(); echo $this->response->content->get();
} }
} }
// End of BaseController.php // End of BaseController.php

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,14 +2,14 @@
/** /**
* Base DB model * 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 * Base model for database interaction
*/ */
class DB extends \Aviat\AnimeClient\Base\Model { class DB extends \Aviat\AnimeClient\Model {
/** /**
* The query builder object * The query builder object
* @var object $db * @var object $db

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -69,4 +69,4 @@ class Page {
echo $this->response->content->get(); echo $this->response->content->get();
} }
} }
// End of Page.php // End of Page.php

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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