@@ 639-648 (lines=10) @@ | ||
636 | } |
|
637 | } |
|
638 | ||
639 | public static function contains($value, $subString, $message = '') |
|
640 | { |
|
641 | if (false === strpos($value, $subString)) { |
|
642 | static::reportInvalidArgument(sprintf( |
|
643 | $message ?: 'Expected a value to contain %2$s. Got: %s', |
|
644 | static::valueToString($value), |
|
645 | static::valueToString($subString) |
|
646 | )); |
|
647 | } |
|
648 | } |
|
649 | ||
650 | public static function notContains($value, $subString, $message = '') |
|
651 | { |
|
@@ 650-659 (lines=10) @@ | ||
647 | } |
|
648 | } |
|
649 | ||
650 | public static function notContains($value, $subString, $message = '') |
|
651 | { |
|
652 | if (false !== strpos($value, $subString)) { |
|
653 | static::reportInvalidArgument(sprintf( |
|
654 | $message ?: '%2$s was not expected to be contained in a value. Got: %s', |
|
655 | static::valueToString($value), |
|
656 | static::valueToString($subString) |
|
657 | )); |
|
658 | } |
|
659 | } |
|
660 | ||
661 | public static function notWhitespaceOnly($value, $message = '') |
|
662 | { |
|
@@ 671-680 (lines=10) @@ | ||
668 | } |
|
669 | } |
|
670 | ||
671 | public static function startsWith($value, $prefix, $message = '') |
|
672 | { |
|
673 | if (0 !== strpos($value, $prefix)) { |
|
674 | static::reportInvalidArgument(sprintf( |
|
675 | $message ?: 'Expected a value to start with %2$s. Got: %s', |
|
676 | static::valueToString($value), |
|
677 | static::valueToString($prefix) |
|
678 | )); |
|
679 | } |
|
680 | } |
|
681 | ||
682 | public static function startsWithLetter($value, $message = '') |
|
683 | { |