File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @author : JIHAD SINNAOUR
4+ * @package : FloatPHP
5+ * @subpackage: Exceptions Component
6+ * @version : 1.0.0
7+ * @category : PHP framework
8+ * @copyright : (c) 2017 - 2021 JIHAD SINNAOUR <[email protected] > 9+ * @link : https://www.floatphp.com
10+ * @license : MIT License
11+ */
12+
13+ namespace FloatPHP \Exceptions \Kernel ;
14+
15+ use FloatPHP \Classes \System \Exception ;
16+
17+ class ConfigException extends Exception
18+ {
19+ /**
20+ * @access public
21+ * @var int $code
22+ * @return string
23+ */
24+ public function get ($ code = 1 )
25+ {
26+ $ header = "[FloatPHPException][ {$ code }] " ;
27+ $ message = "{$ header } Error : {$ this ->getError ($ code )}" ;
28+ $ message .= "<br> {$ header } Line : {$ this ->getLine ()} in {$ this ->getFile ()}" ;
29+ if ( $ this ->getMessage () ) {
30+ $ message .= " ( {$ this ->getMessage ()}) " ;
31+ }
32+ return $ message ;
33+ }
34+
35+ /**
36+ * @access private
37+ * @var int $code
38+ * @return string
39+ */
40+ private function getError ($ code )
41+ {
42+ switch ( intval ($ code ) ) {
43+ case 1 :
44+ return 'Invalid Application Configuration ' ;
45+ break ;
46+ }
47+ return 'Unknown error ' ;
48+ }
49+ }
You can’t perform that action at this time.
0 commit comments