Skip to content

Commit

Permalink
Remove guzzle requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtlambda committed Mar 4, 2016
1 parent b3517b1 commit a7886fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"php": ">=5.4",
"egulias/email-validator": "~1.2",
"jschaedl/iban": "~1.1",
"rmccue/requests": "~1.6",
"guzzlehttp/guzzle": "^6.1"
"rmccue/requests": "~1.6"
},
"require-dev": {
"phpunit/phpunit": "4.5.*",
Expand Down
20 changes: 10 additions & 10 deletions src/fieldwork/sanitizers/IbanSanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace fieldwork\sanitizers;

use fieldwork\sanitizers;
use GuzzleHttp\Client;
//use GuzzleHttp\Client;

class IbanSanitizer extends sanitizers\FieldSanitizer
{
Expand Down Expand Up @@ -66,16 +66,16 @@ public function sanitize ($value)
*/
private static function convertUsingOpenIban ($bban, $username, $password)
{
try {
$client = new Client();
$res = $client->request('GET', self::getRequestEndpoint($bban), [
'auth' => [$username, $password]
]);
$apiResponse = json_decode($res->getBody());
return $apiResponse === null ? null : $apiResponse['iban'];
} catch (\Exception $e) {
// try {
// $client = new Client();
// $res = $client->request('GET', self::getRequestEndpoint($bban), [
// 'auth' => [$username, $password]
// ]);
// $apiResponse = json_decode($res->getBody());
// return $apiResponse === null ? null : $apiResponse['iban'];
// } catch (\Exception $e) {
return null;
}
// }
}

}

0 comments on commit a7886fd

Please sign in to comment.