diff --git a/languages/php/README.md b/languages/php/README.md index ba849b0e1..2bddf73ff 100644 --- a/languages/php/README.md +++ b/languages/php/README.md @@ -27,11 +27,12 @@ be authorized by calling the access_token_login method passing your Bitwarden ac ```php -$api_url = ""; -$identity_url = ""; -$client_settings = new \Bitwarden\Sdk\BitwardenSettings(); +$access_token = ''; +$api_url = ""; +$identity_url = ""; +$bitwarden_settings = new \Bitwarden\Sdk\BitwardenSettings($api_url, $identity_url); -$bitwarden_client = new \Bitwarden\Sdk\BitwardenClient($client_settings); +$bitwarden_client = new \Bitwarden\Sdk\BitwardenClient($bitwarden_settings); $res = $bitwarden_client->access_token_login($access_token); ``` @@ -39,9 +40,7 @@ After successful authorization you can interact with client to manage your proje ```php $organization_id = ""; -$client_settings = new \Bitwarden\Sdk\Schemas\ClientSettings(); - -$bitwarden_client = new \Bitwarden\Sdk\BitwardenClient($client_settings); +$bitwarden_client = new \Bitwarden\Sdk\BitwardenClient($bitwarden_settings); $res = $bitwarden_client->access_token_login($access_token); // create project diff --git a/languages/php/src/BitwardenSettings.php b/languages/php/src/BitwardenSettings.php index 4e4dbff56..34252866a 100644 --- a/languages/php/src/BitwardenSettings.php +++ b/languages/php/src/BitwardenSettings.php @@ -10,26 +10,21 @@ class BitwardenSettings private string $user_agent = "Bitwarden PHP SDK"; - private string $device_type; +// private string $device_type; public function __construct($api_url = null, $identity_url = null, $device_type = null) { if (is_null($api_url)) { - $this->api_url = getenv('API_URL') ?: 'https://api.bitwarden.com'; - $this->identity_url = getenv('IDENTITY_URL') ?: 'https://identity.bitwarden.com'; - } else { - $this->api_url = $api_url; + $this->api_url = 'https://api.bitwarden.com'; } if (is_null($identity_url)) { - $this->identity_url = getenv('IDENTITY_URL') ?: 'https://identity.bitwarden.com'; - } else { - $this->identity_url = $identity_url; + $this->identity_url = 'https://identity.bitwarden.com'; } - $this->device_type = $device_type ? isset($device_type) : ""; +// $this->device_type = $device_type ? isset($device_type) : ""; } public function get_api_url(): string