Skip to content

Commit

Permalink
Revert "changed handling of transfer amounts as this lead ton an erro d…
Browse files Browse the repository at this point in the history
…igitick#28"

This reverts commit 3ce27b0.
  • Loading branch information
Carlo Capocasa committed Apr 15, 2014
1 parent 3ce27b0 commit 4e5d393
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
namespace Digitick\Sepa\TransferInformation;

use Digitick\Sepa\DomBuilder\DomBuilderInterface;
use Digitick\Sepa\Exception\InvalidArgumentException;
use Digitick\Sepa\Util\StringHelper;

class BaseTransferInformation implements TransferInformationInterface
Expand Down Expand Up @@ -84,11 +83,7 @@ class BaseTransferInformation implements TransferInformationInterface
public function __construct($amount, $iban, $name) {
$amount += 0;
if (is_float($amount)) {
if(!function_exists('bcscale')) {
throw new InvalidArgumentException('Using floats for amount is only possible with bcmath enabled');
}
bcscale(2);
$amount = (integer)bcmul($amount, 100);
$amount = (integer) ($amount * 100);
}
$this->transferAmount = $amount;
$this->iban = $iban;
Expand Down Expand Up @@ -194,4 +189,4 @@ public function getRemittanceInformation() {
return $this->remittanceInformation;
}

}
}
8 changes: 1 addition & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="./tests/bootstrap.php"
colors="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="true">
<phpunit bootstrap="./tests/bootstrap.php" color="true">

<testsuites>
<testsuite name="PHP Sepa XML">
Expand Down
144 changes: 0 additions & 144 deletions tests/Unit/SumOutputTest.php

This file was deleted.

0 comments on commit 4e5d393

Please sign in to comment.