@@ 676-685 (lines=10) @@ | ||
673 | } |
|
674 | } |
|
675 | ||
676 | public static function contains($value, $subString, $message = '') |
|
677 | { |
|
678 | if (false === strpos($value, $subString)) { |
|
679 | static::reportInvalidArgument(sprintf( |
|
680 | $message ?: 'Expected a value to contain %2$s. Got: %s', |
|
681 | static::valueToString($value), |
|
682 | static::valueToString($subString) |
|
683 | )); |
|
684 | } |
|
685 | } |
|
686 | ||
687 | public static function notContains($value, $subString, $message = '') |
|
688 | { |
|
@@ 687-696 (lines=10) @@ | ||
684 | } |
|
685 | } |
|
686 | ||
687 | public static function notContains($value, $subString, $message = '') |
|
688 | { |
|
689 | if (false !== strpos($value, $subString)) { |
|
690 | static::reportInvalidArgument(sprintf( |
|
691 | $message ?: '%2$s was not expected to be contained in a value. Got: %s', |
|
692 | static::valueToString($value), |
|
693 | static::valueToString($subString) |
|
694 | )); |
|
695 | } |
|
696 | } |
|
697 | ||
698 | public static function notWhitespaceOnly($value, $message = '') |
|
699 | { |
|
@@ 708-717 (lines=10) @@ | ||
705 | } |
|
706 | } |
|
707 | ||
708 | public static function startsWith($value, $prefix, $message = '') |
|
709 | { |
|
710 | if (0 !== strpos($value, $prefix)) { |
|
711 | static::reportInvalidArgument(sprintf( |
|
712 | $message ?: 'Expected a value to start with %2$s. Got: %s', |
|
713 | static::valueToString($value), |
|
714 | static::valueToString($prefix) |
|
715 | )); |
|
716 | } |
|
717 | } |
|
718 | ||
719 | public static function startsWithLetter($value, $message = '') |
|
720 | { |