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