Skip to content

Commit a6d4f64

Browse files
nanasessclaude
andcommitted
fix: restore missing function parameter in validateAndNormalizeInputs method
- Add missing $function parameter to validateAndNormalizeInputs() method signature - Fix all calls to pass appropriate function name (bcadd, bcsub, bcmul, etc.) - Resolves TypeError: validateNumberString() argument #2 must be string, null given - Fixes CI test failures caused by rector auto-refactoring removing required parameter All 193 tests passing with 496 assertions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e527bba commit a6d4f64

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/BCMath.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ abstract class BCMath
5858
*
5959
* @throws \ValueError if inputs are not well-formed
6060
*/
61-
protected static function validateAndNormalizeInputs(string $num1, string $num2): array
61+
protected static function validateAndNormalizeInputs(string $num1, string $num2, string $function): array
6262
{
6363
self::validateNumberString($num1, $function, 1, 'num1');
6464
self::validateNumberString($num2, $function, 2, 'num2');
@@ -398,7 +398,7 @@ public static function isNegative(BigInteger $x): bool
398398
public static function add(string $num1, string $num2, ?int $scale = null): string
399399
{
400400
// Phase 1: Argument validation
401-
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2);
401+
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2, 'bcadd');
402402

403403
// Phase 2: Scale resolution and validation
404404
$scale = self::resolveScale($scale);
@@ -420,7 +420,7 @@ public static function add(string $num1, string $num2, ?int $scale = null): stri
420420
public static function sub(string $num1, string $num2, ?int $scale = null): string
421421
{
422422
// Phase 1: Argument validation
423-
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2);
423+
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2, 'bcsub');
424424

425425
// Phase 2: Scale resolution and validation
426426
$scale = self::resolveScale($scale);
@@ -442,7 +442,7 @@ public static function sub(string $num1, string $num2, ?int $scale = null): stri
442442
public static function mul(string $num1, string $num2, ?int $scale = null): string
443443
{
444444
// Phase 1: Argument validation
445-
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2);
445+
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2, 'bcmul');
446446

447447
// Phase 2: Scale resolution and validation
448448
$scale = self::resolveScale($scale);
@@ -473,7 +473,7 @@ public static function mul(string $num1, string $num2, ?int $scale = null): stri
473473
public static function div(string $num1, string $num2, ?int $scale = null): string
474474
{
475475
// Phase 1: Argument validation
476-
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2);
476+
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2, 'bcdiv');
477477

478478
// Phase 2: Scale resolution and validation
479479
$scale = self::resolveScale($scale);
@@ -504,7 +504,7 @@ public static function div(string $num1, string $num2, ?int $scale = null): stri
504504
public static function mod(string $num1, string $num2, ?int $scale = null): string
505505
{
506506
// Phase 1: Argument validation
507-
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2);
507+
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2, 'bcmod');
508508

509509
// Phase 2: Scale resolution and validation
510510
$scale = self::resolveScale($scale);
@@ -529,7 +529,7 @@ public static function mod(string $num1, string $num2, ?int $scale = null): stri
529529
public static function comp(string $num1, string $num2, ?int $scale = null): int
530530
{
531531
// Phase 1: Argument validation
532-
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2);
532+
[$num1, $num2] = self::validateAndNormalizeInputs($num1, $num2, 'bccomp');
533533

534534
// Phase 2: Scale resolution and validation
535535
$scale = self::resolveScaleForComparison($scale);

0 commit comments

Comments
 (0)