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