@@ 558-567 (lines=10) @@ | ||
555 | } |
|
556 | } |
|
557 | ||
558 | public static function contains($value, $subString, $message = '') |
|
559 | { |
|
560 | if (false === strpos($value, $subString)) { |
|
561 | static::reportInvalidArgument(sprintf( |
|
562 | $message ?: 'Expected a value to contain %2$s. Got: %s', |
|
563 | static::valueToString($value), |
|
564 | static::valueToString($subString) |
|
565 | )); |
|
566 | } |
|
567 | } |
|
568 | ||
569 | public static function notContains($value, $subString, $message = '') |
|
570 | { |
|
@@ 569-578 (lines=10) @@ | ||
566 | } |
|
567 | } |
|
568 | ||
569 | public static function notContains($value, $subString, $message = '') |
|
570 | { |
|
571 | if (false !== strpos($value, $subString)) { |
|
572 | static::reportInvalidArgument(sprintf( |
|
573 | $message ?: '%2$s was not expected to be contained in a value. Got: %s', |
|
574 | static::valueToString($value), |
|
575 | static::valueToString($subString) |
|
576 | )); |
|
577 | } |
|
578 | } |
|
579 | ||
580 | public static function notWhitespaceOnly($value, $message = '') |
|
581 | { |
|
@@ 590-599 (lines=10) @@ | ||
587 | } |
|
588 | } |
|
589 | ||
590 | public static function startsWith($value, $prefix, $message = '') |
|
591 | { |
|
592 | if (0 !== strpos($value, $prefix)) { |
|
593 | static::reportInvalidArgument(sprintf( |
|
594 | $message ?: 'Expected a value to start with %2$s. Got: %s', |
|
595 | static::valueToString($value), |
|
596 | static::valueToString($prefix) |
|
597 | )); |
|
598 | } |
|
599 | } |
|
600 | ||
601 | public static function startsWithLetter($value, $message = '') |
|
602 | { |