[PSR] Fixed Tests

- Using `php-cs-fixer` tool.
This commit is contained in:
Jay Patel
2016-07-14 13:08:18 -05:00
parent 1401d5563d
commit cffa2463b1
88 changed files with 94 additions and 131 deletions

View File

@@ -8,7 +8,6 @@ require __DIR__ . '/../bootstrap.php';
// ## Approval Status
// Determine if the user accepted or denied the request
if (isset($_GET['success']) && $_GET['success'] == 'true') {
$token = $_GET['token'];
$agreement = new \PayPal\Api\Agreement();
try {
@@ -17,7 +16,7 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
$agreement->execute($token, $apiContext);
} catch (Exception $ex) {
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex);
ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex);
exit(1);
}
@@ -30,13 +29,12 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') {
$agreement = \PayPal\Api\Agreement::get($agreement->getId(), $apiContext);
} catch (Exception $ex) {
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Get Agreement", "Agreement", null, null, $ex);
ResultPrinter::printError("Get Agreement", "Agreement", null, null, $ex);
exit(1);
}
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Get Agreement", "Agreement", $agreement->getId(), null, $agreement);
} else {
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("User Cancelled the Approval", null);