@@ -8,19 +8,19 @@ class CodeigniterVite
88 /**
99 * @var string manifest path.
1010 */
11- private static $ manifest ;
11+ private $ manifest ;
1212
1313 public function __construct ()
1414 {
15- self :: $ manifest = is_file (FCPATH . 'manifest.json ' ) ? FCPATH . 'manifest.json ' : null ;
15+ $ this -> manifest = is_file (FCPATH . 'manifest.json ' ) ? FCPATH . 'manifest.json ' : null ;
1616 }
1717
1818 /**
1919 * Get vite entry file on running or bundled files instead.
2020 *
2121 * @return string single script tag on developing and much more on production
2222 */
23- public static function tags ()
23+ public function tags ()
2424 {
2525 # Check if vite is running.
2626 $ entryFile = env ('VITE_ORIGIN ' ) . '/ ' . env ('VITE_RESOURCES_DIR ' ) . '/ ' . env ('VITE_ENTRY_FILE ' );
@@ -30,14 +30,14 @@ public static function tags()
3030 # React HMR fix.
3131 if (!empty ($ result ))
3232 {
33- $ result = self :: getReactTag () . "$ result " ;
33+ $ result = $ this -> getReactTag () . "$ result " ;
3434 }
3535
3636 # If vite isn't running, then return the compiled resources.
37- if (empty ($ result ) && self :: $ manifest )
37+ if (empty ($ result ) && $ this -> manifest )
3838 {
3939 # Get the manifest content.
40- $ manifest = file_get_contents (self :: $ manifest );
40+ $ manifest = file_get_contents ($ this -> manifest );
4141 # You look much pretty as an php object =).
4242 $ manifest = json_decode ($ manifest );
4343
@@ -67,7 +67,7 @@ public static function tags()
6767 *
6868 * @return string|null a simple module script
6969 */
70- public static function getReactTag ()
70+ public function getReactTag ()
7171 {
7272 if (env ('VITE_FRAMEWORK ' ) === 'react ' )
7373 {
@@ -84,7 +84,7 @@ public static function getReactTag()
8484 *
8585 * @return bool true if vite is runnig or if manifest does exist, otherwise false;
8686 */
87- public static function check (): bool
87+ public function check (): bool
8888 {
8989 # Check if vite is running.
9090 $ entryFile = env ('VITE_ORIGIN ' ) . '/ ' . env ('VITE_RESOURCES_DIR ' ) . '/ ' . env ('VITE_ENTRY_FILE ' );
@@ -93,7 +93,7 @@ public static function check(): bool
9393 {
9494 $ result = true ;
9595 }
96- elseif (!empty (self :: $ manifest ))
96+ elseif (!empty ($ this -> manifest ))
9797 {
9898 $ result = true ;
9999 }
0 commit comments