diff --git a/composer.json b/composer.json index 8cf0314..ce2cd3e 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ "require": { "php": ">=5.4", "ext-curl": "*", - "illuminate/support": "5.2.x|5.3.x|5.4.x|5.5.x|5.6.x|5.7.x|5.8.x", - "illuminate/contracts": "5.2.x|5.3.x|5.4.x|5.5.x|5.6.x|5.7.x|5.8.x", + "illuminate/support": "5.2.x|5.3.x|5.4.x|5.5.x|5.6.x|5.7.x|5.8.x|^6.0", + "illuminate/contracts": "5.2.x|5.3.x|5.4.x|5.5.x|5.6.x|5.7.x|5.8.x|^6.0", "graham-campbell/manager": "^2.4 || ^3.0 || ^4.0", "odenktools/php-bca": "2.*" }, diff --git a/config/bca.php b/config/bca.php index 754cea1..3e90c53 100644 --- a/config/bca.php +++ b/config/bca.php @@ -23,7 +23,13 @@ 'host' => 'sandbox.bca.co.id', 'scheme' => 'https', 'development' => true, - 'options' => [], + 'options' => [ + 'host' => 'sandbox.bca.co.id', + 'scheme' => 'https', + 'timeout' => 60, + 'port' => 443, + 'timezone' => 'Asia/Jakarta' + ], 'port' => 443, 'timeout' => 30, ], @@ -38,7 +44,13 @@ 'host' => 'sandbox.bca.co.id', 'scheme' => 'https', 'development' => true, - 'options' => [], + 'options' => [ + 'host' => 'sandbox.bca.co.id', + 'scheme' => 'https', + 'timeout' => 60, + 'port' => 443, + 'timezone' => 'Asia/Jakarta' + ], 'port' => 443, 'timeout' => 30, ], diff --git a/src/BcaFactory.php b/src/BcaFactory.php index b9eaa3e..814f17d 100644 --- a/src/BcaFactory.php +++ b/src/BcaFactory.php @@ -20,11 +20,11 @@ class BcaFactory * @param array $config * @param array $options optional parameter * - * @return \BcaHttp + * @return BcaHttp */ - public function make(array $config, $options = []) + public function make(array $config, array $options = []) { - $config = $this->getConfig($config, $options); + $config = $this->getConfig($config); return $this->getClient($config, $options); } @@ -33,13 +33,12 @@ public function make(array $config, $options = []) * Get the configuration data. * * @param string[] $config - * @param array $options optional parameter * * @throws \InvalidArgumentException * * @return array */ - protected function getConfig(array $config, $options = array()) + protected function getConfig(array $config) { $keys = [ 'corp_id', @@ -55,7 +54,7 @@ protected function getConfig(array $config, $options = array()) } } - return array_only($config, $keys); + return array_intersect_key($config, array_flip((array)$keys)); } /** @@ -64,9 +63,9 @@ protected function getConfig(array $config, $options = array()) * @param string[] $auth * @param array $options optional parameter * - * @return \BcaHttp + * @return BcaHttp */ - protected function getClient(array $auth, $options = []) + protected function getClient(array $auth, array $options = []) { return new BcaHttp( $auth['corp_id'], diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index 18ccd45..976db9a 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -21,7 +21,7 @@ abstract class AbstractTestCase extends AbstractPackageTestCase * * @return string */ - protected function getServiceProviderClass($app) + protected function getServiceProviderClass() { return BcaServiceProvider::class; }