@@ 624-633 (lines=10) @@ | ||
621 | } |
|
622 | } |
|
623 | ||
624 | public static function contains($value, $subString, $message = '') |
|
625 | { |
|
626 | if (false === strpos($value, $subString)) { |
|
627 | static::reportInvalidArgument(sprintf( |
|
628 | $message ?: 'Expected a value to contain %2$s. Got: %s', |
|
629 | static::valueToString($value), |
|
630 | static::valueToString($subString) |
|
631 | )); |
|
632 | } |
|
633 | } |
|
634 | ||
635 | public static function notContains($value, $subString, $message = '') |
|
636 | { |
|
@@ 635-644 (lines=10) @@ | ||
632 | } |
|
633 | } |
|
634 | ||
635 | public static function notContains($value, $subString, $message = '') |
|
636 | { |
|
637 | if (false !== strpos($value, $subString)) { |
|
638 | static::reportInvalidArgument(sprintf( |
|
639 | $message ?: '%2$s was not expected to be contained in a value. Got: %s', |
|
640 | static::valueToString($value), |
|
641 | static::valueToString($subString) |
|
642 | )); |
|
643 | } |
|
644 | } |
|
645 | ||
646 | public static function notWhitespaceOnly($value, $message = '') |
|
647 | { |
|
@@ 656-665 (lines=10) @@ | ||
653 | } |
|
654 | } |
|
655 | ||
656 | public static function startsWith($value, $prefix, $message = '') |
|
657 | { |
|
658 | if (0 !== strpos($value, $prefix)) { |
|
659 | static::reportInvalidArgument(sprintf( |
|
660 | $message ?: 'Expected a value to start with %2$s. Got: %s', |
|
661 | static::valueToString($value), |
|
662 | static::valueToString($prefix) |
|
663 | )); |
|
664 | } |
|
665 | } |
|
666 | ||
667 | public static function startsWithLetter($value, $message = '') |
|
668 | { |