File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ class WxFinanceSDK
3131 /**
3232 * @var array
3333 */
34- protected static $ wxConfig ;
34+ protected $ wxConfig ;
3535
36- public function __construct (array $ config = [])
36+ public function __construct (array $ config = [], array $ wxConfig = [] )
3737 {
3838 $ default = [
3939 'default ' => 'php-ext ' ,
@@ -53,6 +53,7 @@ public function __construct(array $config = [])
5353 }
5454
5555 $ this ->config = empty ($ config ) ? $ default : array_merge ($ default , $ config );
56+ $ this ->wxConfig = $ wxConfig ;
5657 }
5758
5859 public function __call ($ name , $ arguments )
@@ -68,8 +69,7 @@ public function __call($name, $arguments)
6869
6970 public static function init (array $ wxConfig = [], array $ driverConfig = []): self
7071 {
71- self ::$ wxConfig = $ wxConfig ;
72- return new self ($ driverConfig );
72+ return new self ($ driverConfig , $ wxConfig );
7373 }
7474
7575 /**
@@ -82,6 +82,6 @@ public function provider($providerName): ProviderInterface
8282 if (! $ this ->config ['providers ' ] || ! $ this ->config ['providers ' ][$ providerName ]) {
8383 throw new InvalidArgumentException ("file configurations are missing {$ providerName } options " );
8484 }
85- return (new $ this ->config ['providers ' ][$ providerName ]['driver ' ]())->setConfig (self :: $ wxConfig );
85+ return (new $ this ->config ['providers ' ][$ providerName ]['driver ' ]())->setConfig ($ this -> wxConfig );
8686 }
8787}
You can’t perform that action at this time.
0 commit comments