TExternalFile → IExternalConfigFile (interface instead of trait)

2.x
Julien Rosset 3 years ago
parent 65ce5e2382
commit 7dea458c68

@ -4,9 +4,7 @@ namespace jrosset\EnvReader;
use Exception;
abstract class EnvConfig extends GenericConfig {
use TExternalFile;
abstract class EnvConfig extends GenericConfig implements IExternalConfigFile {
/**
* @inheritDoc
*/

@ -3,13 +3,13 @@
namespace jrosset\EnvReader;
/**
* Trait for config based on an external file
* Interface for config based on an external file
*/
trait TExternalFile {
interface IExternalConfigFile {
/**
* Get the external config file path
*
* @return string The config file path
*/
protected abstract function getConfigFilePath (): string;
public function getConfigFilePath (): string;
}

@ -12,7 +12,7 @@ class Env extends EnvConfig {
'WEBSITE_NAME' => 'Generic site',
];
}
protected function getConfigFilePath (): string {
public function getConfigFilePath (): string {
return __DIR__ . '/.env';
}
}

Loading…
Cancel
Save