/** * This method tests the "find" method. * * @dataProvider data_find */ public function test_find(array $provided, array $expected) { $p0 = IArrayList\Type::make($provided[0], '\\Saber\\Data\\IInt32\\Type'); $p1 = $provided[1]; $r0 = IArrayList\Module::find($p0, $p1); $e0 = $expected[0]; $this->assertInstanceOf($e0, $r0); }
/** * This method (aka "exists" and "some") returns whether some of the items in the list * passed the truthy test. * * @access public * @static * @param IArrayList\Type $xs the left operand * @param callable $predicate the predicate function to be used * @return IBool\Type whether some of the items * passed the truthy test */ public static function any(IArrayList\Type $xs, callable $predicate) : IBool\Type { return IOption\Module::isDefined(IArrayList\Module::find($xs, $predicate)); }