Skip to content

Commit 19ee78c

Browse files
update
1 parent 6377814 commit 19ee78c

24 files changed

+360
-136
lines changed

Asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public static function config(?string $base_path = null, ?bool $cache = false, $
140140
*
141141
* @return int|false
142142
*/
143-
static private function getFiletime(?string $file_path = null)
143+
private static function getFiletime(?string $file_path = null)
144144
{
145145
return file_exists($file_path)
146146
? "?v=" . filemtime($file_path)

AutoloadRegister.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ class AutoloadRegister{
1717
* The base directory to scan for classes and files.
1818
* @var string
1919
*/
20-
static private $baseDirectory;
20+
private static $baseDirectory;
2121

2222
/**
2323
* The class map that stores the class names and their corresponding file paths.
2424
* @var array
2525
*/
26-
static private $classMap = [];
26+
private static $classMap = [];
2727

2828
/**
2929
* The file map that stores the file paths and their corresponding relative paths.
3030
* @var array
3131
*/
32-
static private $fileMap = [];
32+
private static $fileMap = [];
3333

3434
/**
3535
* Autoload function to load class and files in a given folder
@@ -65,7 +65,7 @@ public static function load(string|array $baseDirectory)
6565
* - Scanning the directory, and registering the autoload method.
6666
* @return void
6767
*/
68-
static private function boot()
68+
private static function boot()
6969
{
7070
self::generateClassMap();
7171
self::generateFileMap();
@@ -79,7 +79,7 @@ static private function boot()
7979
* @param string $className The name of the class to load.
8080
* @return void
8181
*/
82-
static private function loadClass($className)
82+
private static function loadClass($className)
8383
{
8484
$filePath = self::$classMap[$className] ?? null;
8585
if ($filePath && file_exists($filePath)) {
@@ -92,7 +92,7 @@ static private function loadClass($className)
9292
*
9393
* @return void
9494
*/
95-
static private function loadFiles()
95+
private static function loadFiles()
9696
{
9797
foreach (self::$fileMap as $fileName => $filePath) {
9898
if (file_exists($filePath)) {
@@ -106,7 +106,7 @@ static private function loadFiles()
106106
*
107107
* @return void
108108
*/
109-
static private function generateClassMap()
109+
private static function generateClassMap()
110110
{
111111
$fileIterator = new RecursiveIteratorIterator(
112112
new RecursiveDirectoryIterator(self::$baseDirectory)
@@ -128,7 +128,7 @@ static private function generateClassMap()
128128
*
129129
* @return void
130130
*/
131-
static private function generateFileMap()
131+
private static function generateFileMap()
132132
{
133133
$fileIterator = new RecursiveIteratorIterator(
134134
new RecursiveDirectoryIterator(self::$baseDirectory)
@@ -153,7 +153,7 @@ static private function generateFileMap()
153153
* @param string $filePath The file path.
154154
* @return string The relative path.
155155
*/
156-
static private function getRelativePath($filePath)
156+
private static function getRelativePath($filePath)
157157
{
158158
$relativePath = substr($filePath, strlen(self::$baseDirectory));
159159
return ltrim($relativePath, '/\\');
@@ -165,7 +165,7 @@ static private function getRelativePath($filePath)
165165
* @param string $filePath The file path.
166166
* @return string|null The class name, or null if not found.
167167
*/
168-
static private function getClassName($filePath)
168+
private static function getClassName($filePath)
169169
{
170170
$namespace = '';
171171
$content = File::get($filePath);

Capsule/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static function envDummy()
8282
*
8383
* @return string
8484
*/
85-
static private function generate($length = 32)
85+
private static function generate($length = 32)
8686
{
8787
$randomBytes = random_bytes($length);
8888
$appKey = 'base64:' . rtrim(strtr(base64_encode($randomBytes), '+/', '-_'), '=');

Cookie.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public static function all($name = null)
224224
* @param int|string $minutes
225225
* @return int
226226
*/
227-
static private function minutesToExpire($minutes = 0)
227+
private static function minutesToExpire($minutes = 0)
228228
{
229229
// options
230230
if(empty($minutes)){
@@ -253,7 +253,7 @@ static private function minutesToExpire($minutes = 0)
253253
* @param bool|null $force
254254
* @return array
255255
*/
256-
static private function getDefaultPathAndDomain($path = null, $value = null, $domain = null, $secure = null, $httponly = null, $force = null)
256+
private static function getDefaultPathAndDomain($path = null, $value = null, $domain = null, $secure = null, $httponly = null, $force = null)
257257
{
258258
return [
259259
!empty($path) ? $path : '/',

Country.php

Lines changed: 40 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,103 +10,94 @@
1010
class Country {
1111

1212
use CountryTrait;
13+
1314

1415
/**
15-
* Get Country ISO 3
16-
* @param string|null $mode
16+
* Alias for getCountryIso3() method
17+
*
18+
* @param string|null $mode
1719
* @return string|null
1820
*/
19-
public static function getCountryIso3($mode = null)
21+
public static function iso3($mode = null)
2022
{
21-
return self::countryIso3()[self::mode($mode)] ?? null;
23+
return self::getCountryIso3($mode);
2224
}
23-
25+
2426
/**
25-
* Get Country ISO 2
26-
* @param string|null $mode
27+
* Alias for getCountryIso2() method
28+
*
29+
* @param string|null $mode
2730
* @return string|null
2831
*/
29-
public static function getCountryIso2($mode = null)
32+
public static function iso2($mode = null)
3033
{
31-
return self::countryIso2()[self::mode($mode)] ?? null;
34+
return self::getCountryIso2($mode);
3235
}
3336

3437
/**
35-
* Get Country Flags for ISO 3
36-
* @param string|null $mode
38+
* Alias for getCountryFlagIso3() method
39+
*
40+
* @param string|null $mode
3741
* @return string|null
3842
*/
39-
public static function getCountryFlagIso3($mode = null)
43+
public static function flagIso3($mode = null)
4044
{
41-
return self::countryFlagIso3()[self::mode($mode)] ?? null;
45+
return self::getCountryFlagIso3($mode);
4246
}
4347

4448
/**
45-
* Get Country Flags for ISO 2
46-
* @param string|null $mode
49+
* Alias for getCountryFlagIso2() method
50+
*
51+
* @param string|null $mode
4752
* @return string|null
4853
*/
49-
public static function getCountryFlagIso2($mode = null)
54+
public static function flagIso2($mode = null)
5055
{
51-
return self::countryFlagIso2()[self::mode($mode)] ?? null;
56+
return self::getCountryFlagIso2($mode);
5257
}
5358

5459
/**
55-
* Get Months Data
60+
* Alias for getMonths() method
5661
*
62+
* @param string|null $mode
5763
* @return string|null
5864
*/
59-
public static function getMonths($mode = null)
65+
public static function month($mode = null)
6066
{
61-
return self::months()[$mode] ?? null;
67+
return self::getMonths($mode);
6268
}
6369

6470
/**
65-
* Get Week
66-
* @param string|null $mode
71+
* Alias for getWeeks() method
72+
*
73+
* @param string|null $mode
6774
* @return string|null
6875
*/
69-
public static function getWeeks($mode = null)
76+
public static function week($mode = null)
7077
{
71-
return self::weeks()[$mode] ?? null;
78+
return self::getWeeks($mode);
7279
}
7380

7481
/**
75-
* Get Time Zones
76-
*
77-
* @param string|null $mode
78-
* @param string|null $default
82+
* Alias for getTimeZone() method
7983
*
84+
* @param string|null $mode
8085
* @return string|null
8186
*/
82-
public static function getTimeZone($mode = null, ?string $default = 'UTC')
87+
public static function zone($mode = null)
8388
{
84-
$data = self::timeZone();
85-
86-
// check if mode is numeric
87-
if(is_numeric($mode)){
88-
return $data[(int) $mode] ?? $default;
89-
}
90-
91-
// flip array to get position num
92-
$flip = array_flip($data);
93-
94-
return $data[$flip[$mode] ?? null] ?? $default;
89+
return self::getTimeZone($mode);
9590
}
9691

9792
/**
98-
* Get Captcha Locale
99-
* @param string|null $mode
93+
* Alias for getCaptchaLocale() method
10094
*
101-
* @return string|null
95+
* @return array
10296
*/
103-
public static function getCaptchaLocale($mode = null)
97+
public static function captcha()
10498
{
105-
$data = self::captchaLocale();
106-
107-
return $data[$mode]
108-
?? array_flip($data)[$mode]
109-
?? null;
99+
return self::getCaptchaLocale();
110100
}
101+
111102

112103
}

Env.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class Env {
2828
*
2929
* @var mixed
3030
*/
31-
static private $sym_path;
31+
private static $sym_path;
3232

3333
/**
3434
* Instance of self class
3535
* @var mixed
3636
*/
37-
static private $class;
37+
private static $class;
3838

3939
/**
4040
* Define custom Server root path
@@ -59,7 +59,7 @@ public function __construct($path = null)
5959
* Initialization of self class
6060
* @return void
6161
*/
62-
static private function init()
62+
private static function init()
6363
{
6464
self::$class = new self();
6565
}
@@ -333,7 +333,7 @@ public static function updateENV($key = null, $value = null, ?bool $quote = true
333333
*
334334
* @return void
335335
*/
336-
static private function createDir_AndFiles($directory = null, $filename = null)
336+
private static function createDir_AndFiles($directory = null, $filename = null)
337337
{
338338
// if system path is null
339339
// calling the `new self()` will initalize the class and set the default path for us
@@ -364,7 +364,7 @@ static private function createDir_AndFiles($directory = null, $filename = null)
364364
* @param string|null $path
365365
* @return void
366366
*/
367-
static private function createSymPath($path = null)
367+
private static function createSymPath($path = null)
368368
{
369369
// if sym_path is null
370370
if(is_null(self::$sym_path) || !(empty($path) && is_null($path))){
@@ -386,7 +386,7 @@ static private function createSymPath($path = null)
386386
*
387387
* @return bool
388388
*/
389-
static private function isDotenvInstalled()
389+
private static function isDotenvInstalled()
390390
{
391391
if(class_exists('Dotenv\Dotenv')){
392392
return true;
@@ -400,7 +400,7 @@ static private function isDotenvInstalled()
400400
*
401401
* @return array
402402
*/
403-
static private function error_levels()
403+
private static function error_levels()
404404
{
405405
return array(
406406
E_ERROR => 'Fatal Error',
@@ -421,7 +421,7 @@ static private function error_levels()
421421
*
422422
* @return bool
423423
*/
424-
static private function is_debug()
424+
private static function is_debug()
425425
{
426426
return Manager::isEnvBool(env('APP_DEBUG', true));
427427
}
@@ -431,7 +431,7 @@ static private function is_debug()
431431
*
432432
* @return bool Returns true if the application is running in local environment, false otherwise.
433433
*/
434-
static private function is_local()
434+
private static function is_local()
435435
{
436436
// check using default setting
437437
if(env('APP_ENV') == 'local'){
@@ -447,7 +447,7 @@ static private function is_local()
447447
*
448448
* @return string
449449
*/
450-
static private function envTxt()
450+
private static function envTxt()
451451
{
452452
return (new Manager)->envDummy();
453453
}

Hash.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static function check($newPassword, $oldHashedPassword)
5555
* @param mixed $maxPasswordLength
5656
* @return void
5757
*/
58-
static private function passwordLengthVerifier($password, $maxPasswordLength = 72)
58+
private static function passwordLengthVerifier($password, $maxPasswordLength = 72)
5959
{
6060
try {
6161
if (mb_strlen($password, 'UTF-8') > $maxPasswordLength) {

0 commit comments

Comments
 (0)