re-namespace and remove class
This commit is contained in:
@@ -2,16 +2,17 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Potter\Environment;
|
namespace Potter;
|
||||||
|
|
||||||
|
use \Dotenv\Dotenv;
|
||||||
use \Potter\Container;
|
use \Potter\Container;
|
||||||
|
|
||||||
trait Behaviour
|
trait Environment
|
||||||
{
|
{
|
||||||
private static function addEnvironment(Container $container): void
|
private static function addEnvironment(Container $container): void
|
||||||
{
|
{
|
||||||
$container->addShared(Environment::class, function () {
|
$container->addShared(Dotenv::class, function () {
|
||||||
return Environment::createImmutable(getcwd()); });
|
return Dotenv::createImmutable(getcwd()); });
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function addEnvironmentBehaviour(Container $container): void
|
private static function addEnvironmentBehaviour(Container $container): void
|
||||||
@@ -21,13 +22,13 @@ trait Behaviour
|
|||||||
$environment->load();
|
$environment->load();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getEnvironment(Container $container): \Dotenv\Dotenv
|
private static function getEnvironment(Container $container): Dotenv
|
||||||
{
|
{
|
||||||
return $container->get(Environment::class);
|
return $container->get(Dotenv::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function hasEnvironment(Container $container): bool
|
private static function hasEnvironment(Container $container): bool
|
||||||
{
|
{
|
||||||
return $container->has(Environment::class);
|
return $container->has(Dotenv::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Potter\Environment;
|
|
||||||
|
|
||||||
final class Environment
|
|
||||||
extends \Dotenv\Dotenv
|
|
||||||
{ }
|
|
||||||
Reference in New Issue
Block a user