Move factory classes to a subfolder

This commit is contained in:
Pierre Rudloff 2020-10-20 23:29:50 +02:00
parent 123a6c5ad9
commit 0a220d4d8e
9 changed files with 21 additions and 17 deletions

View file

@ -1,7 +1,10 @@
<?php
namespace Alltube;
namespace Alltube\Factory;
use Alltube\Config;
use Alltube\Exception\ConfigException;
use Alltube\UglyRouter;
use Slim\Container;
use Symfony\Component\ErrorHandler\Debug;
@ -13,12 +16,13 @@ class ConfigFactory
{
/**
* @param Container $container
* @return Config
* @throws Exception\ConfigException
* @throws ConfigException
*/
public static function create(Container $container)
{
$configPath = __DIR__ . '/../config/config.yml';
$configPath = __DIR__ . '/../../config/config.yml';
if (is_file($configPath)) {
$config = Config::fromFile($configPath);
} else {

View file

@ -1,8 +1,9 @@
<?php
namespace Alltube;
namespace Alltube\Factory;
use Alltube\Exception\DependencyException;
use Alltube\LocaleManager;
/**
* Class LocaleManagerFactory

View file

@ -1,6 +1,6 @@
<?php
namespace Alltube;
namespace Alltube\Factory;
use Consolidation\Log\Logger;
use Consolidation\Log\LogOutputStyler;

View file

@ -4,8 +4,9 @@
* ViewFactory class.
*/
namespace Alltube;
namespace Alltube\Factory;
use Alltube\LocaleManager;
use Psr\Container\ContainerInterface;
use Slim\Http\Request;
use Slim\Http\Uri;
@ -33,7 +34,7 @@ class ViewFactory
$request = $container->get('request');
}
$view = new Smarty(__DIR__ . '/../templates/');
$view = new Smarty(__DIR__ . '/../../templates/');
/** @var Uri $uri */
$uri = $request->getUri();