Skip to content

Commit 20c25fb

Browse files
Merge pull request #84 from Abraham-Flutterwave/dev
Update: Remove all Enums to Support PHP7.4 and Refactor setup script.
2 parents 26a481e + 6bcc966 commit 20c25fb

File tree

4 files changed

+6
-65
lines changed

4 files changed

+6
-65
lines changed

src/Config/PackageConfig.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ final class PackageConfig extends AbstractConfig implements ConfigInterface
2222
private function __construct(string $secretKey, string $publicKey, string $encryptKey, string $env)
2323
{
2424
parent::__construct($secretKey, $publicKey, $encryptKey, $env);
25-
$this->logger->pushHandler(new RotatingFileHandler(__DIR__ . "../../../../../../" . self::LOG_FILE_NAME, 90));
2625
}
2726

2827
public static function setUp(string $secretKey, string $publicKey, string $enc, string $env, ?LoggerInterface $customLogger = null): ConfigInterface
@@ -32,9 +31,12 @@ public static function setUp(string $secretKey, string $publicKey, string $enc,
3231
if ($customLogger) {
3332
$instance->logger = $customLogger;
3433
} else {
35-
$rootPath = __DIR__ . '/../../../../../../';
36-
$logDir = $rootPath . $_ENV['FLW_LOG_DIR'] ?? 'logs';
37-
34+
$vendorPath = dirname(__DIR__, 4);
35+
$rootPath = dirname($vendorPath);
36+
37+
$logSubDir = $_ENV['FLW_LOG_DIR'] ?? 'logs';
38+
$logDir = $rootPath . DIRECTORY_SEPARATOR . $logSubDir;
39+
3840
if (!is_dir($logDir)) {
3941
if (!mkdir($logDir, 0775, true) && !is_dir($logDir)) {
4042
throw new \RuntimeException("Flutterwave: Failed to create log directory at $logDir");

src/Enum/Currency.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Enum/Method.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Enum/Momo.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)