File tree Expand file tree Collapse file tree 4 files changed +132
-83
lines changed Expand file tree Collapse file tree 4 files changed +132
-83
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * @Package: some useful php string utility methods
5+ * @Class : Facade
6+ * @Author : Nima jahan bakhshian / dvlpr1996 <nimajahanbakhshian@gmail.com>
7+ * @URL : https://github.com/dvlpr1996
8+ * @License: MIT License Copyright (c) 2022 (until present) Nima jahan bakhshian
9+ */
10+
11+ declare (strict_types=1 );
12+
13+ namespace PhpStringHelpers \Facade ;
14+
15+ use RuntimeException ;
16+
17+ class Facade
18+ {
19+ protected static $ getFacadeName ;
20+
21+ public static function __callStatic ($ name , $ arguments )
22+ {
23+ $ instance = new static::$ getFacadeName ;
24+
25+ if (!$ instance )
26+ throw new RuntimeException ('A facade root has not been set. ' );
27+
28+ return $ instance ->$ name (...$ arguments );
29+ }
30+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * @Package: some useful php string utility methods
5+ * @Class : StrUtility
6+ * @Author : Nima jahan bakhshian / dvlpr1996 <nimajahanbakhshian@gmail.com>
7+ * @URL : https://github.com/dvlpr1996
8+ * @License: MIT License Copyright (c) 2022 (until present) Nima jahan bakhshian
9+ */
10+
11+ declare (strict_types=1 );
12+
13+ namespace PhpStringHelpers \Facade ;
14+
15+ use PhpStringHelpers \Facade \Facade ;
16+
17+ class StrUtility extends Facade
18+ {
19+ protected static $ getFacadeName = '\PhpStringHelpers\utility\StrUtility ' ;
20+ }
Original file line number Diff line number Diff line change 99
1010declare (strict_types=1 );
1111
12- use PhpStringHelpers \utility \StrUtility as strHelpers ;
12+ use PhpStringHelpers \Facade \StrUtility as strHelpers ;
1313
1414if (!function_exists ('toCamelCase ' )) {
1515 function toCamelCase (string $ words ): string
You can’t perform that action at this time.
0 commit comments