File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 11<?php namespace Winter \Storm \Support ;
22
33use Illuminate \Support \ServiceProvider as ServiceProviderBase ;
4+ use Winter \Storm \Foundation \Application ;
45use Winter \Storm \Foundation \Extension \WinterExtension ;
56use Winter \Storm \Packager \Composer ;
67use Winter \Storm \Support \ClassLoader ;
@@ -17,6 +18,10 @@ abstract class ModuleServiceProvider extends ServiceProviderBase implements Wint
1718 */
1819 protected $ app ;
1920
21+ protected string $ path ;
22+
23+ protected string $ identifier ;
24+
2025 /**
2126 * Bootstrap the application events.
2227 * @return void
@@ -107,6 +112,16 @@ public function getVersion(): string
107112 return $ this ->composerPackage ['versions ' ][0 ] ?? 'dev-unknown ' ;
108113 }
109114
115+ public function getPath (): string
116+ {
117+ return $ this ->path ?? $ this ->path = dirname ((new \ReflectionClass (get_called_class ()))->getFileName ());
118+ }
119+
120+ public function getIdentifier (): string
121+ {
122+ return $ this ->identifier ?? $ this ->identifier = (new \ReflectionClass (get_called_class ()))->getNamespaceName ();
123+ }
124+
110125 public function __toString (): string
111126 {
112127 return $ this ->getIdentifier ();
You can’t perform that action at this time.
0 commit comments