1111
1212namespace Josantonius \HTTPStatusCode ;
1313
14- # use Josantonius\HTTPStatusCode\Exception\HTTPStatusCodeException;
15-
1614/**
1715 * HTTP response status codes handler.
1816 *
@@ -49,27 +47,27 @@ class HTTPStatusCode {
4947 */
5048 protected static function load ($ lang = 'en ' ) {
5149
52- if ($ lang != static ::$ lang ) {
50+ if ($ lang != self ::$ lang ) {
5351
54- static ::$ status = null ;
52+ self ::$ status = null ;
5553
56- static ::$ lang = $ lang ;
54+ self ::$ lang = $ lang ;
5755 }
5856
59- if (is_null (static ::$ status )) {
57+ if (is_null (self ::$ status )) {
6058
61- $ filepath = __DIR__ . " /resources/http-status-code.jsond " ;
59+ $ filepath = __DIR__ . ' /resources/http-status-code.jsond ' ;
6260
6361 $ jsonFile = file_get_contents ($ filepath );
6462
6563 $ status = json_decode ($ jsonFile , true );
6664
67- static ::$ status = $ status ['data ' ][$ lang ];
65+ self ::$ status = $ status ['data ' ][$ lang ];
6866
6967 unset($ status );
7068 }
7169
72- return static ::$ status ;
70+ return self ::$ status ;
7371 }
7472
7573 /**
@@ -78,18 +76,18 @@ protected static function load($lang = 'en') {
7876 * @since 1.0.0
7977 *
8078 * @param int $code → 100 - 511 → HTTP status code definition
81- * @param string $code → " 1xx" - " 5xx" → HTTP status code general type definition
79+ * @param string $code → ' 1xx' - ' 5xx' → HTTP status code general type definition
8280 * @param string $lang → language for definition
83- * @param string $size → " short" → short definition
84- * " large" → large definition
81+ * @param string $size → ' short' → short definition
82+ * ' large' → large definition
8583 *
8684 * @return string → HTTP status code definition
8785 */
8886 public static function get ($ code , $ lang = 'en ' , $ size = 'short ' ) {
8987
90- static ::load ($ lang );
88+ self ::load ($ lang );
9189
92- $ result = (isset (static ::$ status [$ code ][$ size ])) ? static ::$ status [$ code ][$ size ] : " Undefined " ;
90+ $ result = (isset (self ::$ status [$ code ][$ size ])) ? self ::$ status [$ code ][$ size ] : ' Undefined ' ;
9391
9492 return $ result ;
9593 }
@@ -105,6 +103,6 @@ public static function get($code, $lang = 'en', $size = 'short') {
105103 */
106104 public static function getAll ($ lang = 'en ' ) {
107105
108- return static ::load ($ lang );
106+ return self ::load ($ lang );
109107 }
110108}
0 commit comments