Skip to content

Commit a56b4f1

Browse files
author
Fredrick Peter
committed
Helpers and Trait Fix
1 parent 37200bf commit a56b4f1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ class PostClass extends DB{
14351435
| config_pagination() | Same as `$db->configPagination()` or `EnvAutoLoad::configPagination` |
14361436
| autoload_register() | Same as `AutoloadRegister::load()` |
14371437
| app_data() | Get `path\|database\|pagination` info |
1438-
| env() | Same as `$db->AppConfig()` |
1438+
| env() | Same as `$db->env()` |
14391439
| env_orm() | Return instance of `(new EnvOrm)` class |
14401440
| env_start() | Same as `EnvAutoLoad::start()` |
14411441
| import() | Return instance of `(new DBImport)` class |

src/Traits/ReusableTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ trait ReusableTrait{
4343
public function dump(...$data)
4444
{
4545
// get App Config
46-
$appConfig = (new MySqlExec)->env();
46+
$envData = (new MySqlExec)->env();
4747

4848
// get bg
4949
$bg = isset($_ENV['APP_DEBUG_BG'])
5050
? $_ENV['APP_DEBUG_BG']
51-
: isset($appConfig['APP_DEBUG_BG'])
51+
: isset($envData['APP_DEBUG_BG'])
5252
?? $this->bg;
5353

5454
// app data
55-
$App = is_array($appConfig)
56-
? $appConfig['APP_DEBUG']
55+
$App = is_array($envData)
56+
? $envData['APP_DEBUG']
5757
: true;
5858

5959
// if DEBUG MODE IS ON

src/helpers.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ function import()
106106
function env(?string $key = null)
107107
{
108108
// get Config data from ENV file
109-
$AppConfig = (new MySqlExec)->env();
109+
$envData = (new MySqlExec)->env();
110110

111111
// Convert all keys to lowercase
112-
$AppConfig = array_change_key_case($AppConfig, CASE_UPPER);
112+
$envData = array_change_key_case($envData, CASE_UPPER);
113113

114114
// convert to upper-case
115115
$key = strtoupper(trim((string) $key));
116116

117-
return $AppConfig[$key] ?? $AppConfig;
117+
return $envData[$key] ?? $envData;
118118
}
119119
}
120120

0 commit comments

Comments
 (0)