/** * This method returns the numerically lowest value. * * @access public * @static * @param IRegex\Type $xs the left operand * @param IRegex\Type $ys the right operand * @return IRegex\Type the minimum value */ public static function min(IRegex\Type $xs, IRegex\Type $ys) : IRegex\Type { return IRegex\Module::compare($xs, $ys)->unbox() <= 0 ? $xs : $ys; }
/** * This method tests the "min" method. * * @dataProvider data_min */ public function test_min(array $provided, array $expected) { $p0 = IRegex\Module::min(IRegex\Type::box($provided[0]), IRegex\Type::box($provided[1])); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\IRegex\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method returns an array list of substrings that were delimited by a whitespace * character. * * @access public * @static * @param IString\Type $xs the left operand * @return IArrayList\Type an array list of substrings */ public static function words(IString\Type $xs) { return IRegex\Module::split(IRegex\Type::box('/\\s+/'), $xs); }