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; use Exception;
abstract class EnvConfig extends GenericConfig { abstract class EnvConfig extends GenericConfig implements IExternalConfigFile {
use TExternalFile;
/** /**
* @inheritDoc * @inheritDoc
*/ */

@ -3,13 +3,13 @@
namespace jrosset\EnvReader; 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 * Get the external config file path
* *
* @return string The 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', 'WEBSITE_NAME' => 'Generic site',
]; ];
} }
protected function getConfigFilePath (): string { public function getConfigFilePath (): string {
return __DIR__ . '/.env'; return __DIR__ . '/.env';
} }
} }

Loading…
Cancel
Save