Skip to content

Commit 19d25db

Browse files
author
Vaidas Lažauskas
committed
Some code style fixes and validating positive number regexp fix
1 parent 2a8c97e commit 19d25db

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

src/BcMath.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function getScale()
6868
* @param BcMath_Number|string $leftOperand
6969
* @param BcMath_Number|string $rightOperand
7070
*
71-
* @return BcMath_Number The sum of the two operands, as a string.
71+
* @return string The sum of the two operands, as a string.
7272
*/
7373
public function addition($leftOperand, $rightOperand)
7474
{
@@ -87,7 +87,7 @@ public function addition($leftOperand, $rightOperand)
8787
* @param BcMath_Number|string $leftOperand
8888
* @param BcMath_Number|string $rightOperand
8989
*
90-
* @return BcMath_Number The result of the subtraction, as a string.
90+
* @return string The result of the subtraction, as a string.
9191
*/
9292
public function subtraction($leftOperand, $rightOperand)
9393
{

src/BcMath/Command/Addition.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ public static function process(BcMath_Number $left, BcMath_Number $right, BcMath
3030
$command($left->getValue(), $right->getValue(), $scale->getValue())
3131
);
3232
}
33-
3433
}

src/BcMath/Command/Comparison.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ public static function process(BcMath_Number $left, BcMath_Number $right, BcMath
3030
$command($left->getValue(), $right->getValue(), $scale->getValue())
3131
);
3232
}
33-
3433
}

src/BcMath/PositiveNumber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class BcMath_PositiveNumber extends BcMath_Number
1616
*/
1717
public function isValid($number)
1818
{
19-
return (boolean) preg_match('/^\d+$/', $number);
19+
return (boolean) preg_match('/^\d+(\.\d+)?$/', $number);
2020
}
2121

2222
/**

0 commit comments

Comments
 (0)