File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 88 * @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected] > 99 * @link : https://www.floatphp.com
1010 * @license : MIT License
11+ *
12+ * This file if a part of FloatPHP Framework
1113 */
1214
1315namespace FloatPHP \Exceptions \Kernel ;
@@ -21,10 +23,10 @@ class ConfigException extends Exception
2123 * @var int $code
2224 * @return string
2325 */
24- public function get ($ code = 1 )
26+ public function get (int $ code = 1 ) : string
2527 {
26- $ header = "[FloatPHPException][ { $ code } ] " ;
27- $ message = "{$ header } Error : {$ this ->getError ($ code )}" ;
28+ $ header = "[FloatPHPException] " ;
29+ $ message = "{$ header } Error [ { $ code } ] : {$ this ->getError ($ code )}" ;
2830 if ( $ this ->getMessage () ) {
2931 $ message .= " ( {$ this ->getMessage ()}) " ;
3032 }
@@ -36,7 +38,7 @@ public function get($code = 1)
3638 * @var int $code
3739 * @return string
3840 */
39- private function getError ($ code )
41+ private function getError (int $ code ) : string
4042 {
4143 switch ( intval ($ code ) ) {
4244 case 1 :
@@ -45,7 +47,10 @@ private function getError($code)
4547 case 2 :
4648 return 'Invalid Module Configuration ' ;
4749 break ;
50+ case 3 :
51+ return 'Invalid Database Configuration ' ;
52+ break ;
4853 }
49- return 'Unknown error ' ;
54+ return 'Invalid Configuration ' ;
5055 }
5156}
You can’t perform that action at this time.
0 commit comments