re-namespace and remove class
This commit is contained in:
@@ -2,16 +2,17 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Potter\Environment;
|
||||
namespace Potter;
|
||||
|
||||
use \Dotenv\Dotenv;
|
||||
use \Potter\Container;
|
||||
|
||||
trait Behaviour
|
||||
trait Environment
|
||||
{
|
||||
private static function addEnvironment(Container $container): void
|
||||
{
|
||||
$container->addShared(Environment::class, function () {
|
||||
return Environment::createImmutable(getcwd()); });
|
||||
$container->addShared(Dotenv::class, function () {
|
||||
return Dotenv::createImmutable(getcwd()); });
|
||||
}
|
||||
|
||||
private static function addEnvironmentBehaviour(Container $container): void
|
||||
@@ -21,13 +22,13 @@ trait Behaviour
|
||||
$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
|
||||
{
|
||||
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