File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ final class LicenseController
1111
1212 public function __construct ()
1313 {
14- $ httpClass = PluginCommonConfig::getClassPreFix () . 'WPKit\Http\Client\HttpClient ' ;
14+ $ httpClass = PluginCommonConfig::getVendorClassPrefix () . 'WPKit\Http\Client\HttpClient ' ;
1515
1616 if (class_exists ($ httpClass )) {
1717 $ this ->httpClient = (new $ httpClass ())->setBaseUri (PluginCommonConfig::getApiEndPoint ());
Original file line number Diff line number Diff line change @@ -107,9 +107,22 @@ public static function getApiEndPoint()
107107 return self ::$ apiEndPoint ;
108108 }
109109
110- public static function getClassPreFix ()
110+ public static function getClassPrefix ()
111111 {
112- return !empty (self ::$ pluginNamespace ) ? self ::$ pluginNamespace : 'BitApps \\' . self ::convertToCamelCase (self ::$ proPluginSlug ) . '\\Deps \\BitApps \\' ;
112+ if (!empty (self ::$ pluginNamespace )) {
113+ return self ::$ pluginNamespace ;
114+ }
115+
116+ return 'BitApps \\' . self ::convertToCamelCase (self ::$ proPluginSlug );
117+ }
118+
119+ public static function getVendorClassPrefix ()
120+ {
121+ if (!empty (self ::$ pluginNamespace )) {
122+ return self ::$ pluginNamespace . '\\Deps \\BitApps \\' ;
123+ }
124+
125+ return 'BitApps \\' . self ::convertToCamelCase (self ::$ proPluginSlug ) . '\\Deps \\BitApps \\' ;
113126 }
114127
115128 private static function convertToCamelCase ($ slug )
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public static function getUpdatedInfo()
3838 if (!empty ($ licenseData ) && \is_array ($ licenseData ) && $ licenseData ['status ' ] === 'success ' ) {
3939 $ licenseKey = $ licenseData ['key ' ];
4040 }
41- $ httpClass = PluginCommonConfig::getClassPreFix () . 'WPKit\Http\Client\HttpClient ' ;
41+ $ httpClass = PluginCommonConfig::getVendorClassPrefix () . 'WPKit\Http\Client\HttpClient ' ;
4242
4343 $ client = (new $ httpClass ())->setBaseUri (PluginCommonConfig::getApiEndPoint ());
4444
@@ -60,7 +60,7 @@ public static function getUpdatedInfo()
6060
6161 $ pluginData = $ pluginInfoResponse ->data ;
6262
63- $ dateTimeClass = PluginCommonConfig::getClassPreFix () . 'WPKit\Helpers\DateTimeHelper ' ;
63+ $ dateTimeClass = PluginCommonConfig::getVendorClassPrefix () . 'WPKit\Helpers\DateTimeHelper ' ;
6464
6565 $ dateTimeHelper = new $ dateTimeClass ();
6666
You can’t perform that action at this time.
0 commit comments