/** * Creates collection of comparable items * * If a type is not provided, the item type is dynamic. * * The item type must be a fully-qualified class name that implements: * `Novuso\System\Type\Comparable` * * @param string|null $itemType The item type * * @return SortedSet */ public static function comparable(string $itemType = null) : SortedSet { assert(Validate::isNull($itemType) || Validate::implementsInterface($itemType, Comparable::class), sprintf('%s expects $itemType to implement %s', __METHOD__, Comparable::class)); return new static(new ComparableComparator(), $itemType); }
/** * @dataProvider invalidNullProvider */ public function test_that_is_null_returns_false_for_invalid_value($value) { $this->assertFalse(Validate::isNull($value)); }