/** * This method returns the numerically lowest value. * * @access public * @static * @param IUnit\Type $x the left operand * @param IUnit\Type $y the right operand * @return IUnit\Type the minimum value */ public static function min(IUnit\Type $x, IUnit\Type $y) : IUnit\Type { return IUnit\Module::compare($x, $y)->unbox() <= 0 ? $x : $y; }
/** * This method tests the "min" method. */ public function test_min() { $p0 = IUnit\Module::min(IUnit\Type::instance(), IUnit\Type::instance()); $this->assertInstanceOf('\\Saber\\Data\\IUnit\\Type', $p0); $this->assertNull($p0->unbox()); }