@@ 514-523 (lines=10) @@ | ||
511 | } |
|
512 | } |
|
513 | ||
514 | public static function contains($value, $subString, $message = '') |
|
515 | { |
|
516 | if (false === strpos($value, $subString)) { |
|
517 | static::reportInvalidArgument(sprintf( |
|
518 | $message ?: 'Expected a value to contain %2$s. Got: %s', |
|
519 | static::valueToString($value), |
|
520 | static::valueToString($subString) |
|
521 | )); |
|
522 | } |
|
523 | } |
|
524 | ||
525 | public static function notWhitespaceOnly($value, $message = '') |
|
526 | { |
|
@@ 535-544 (lines=10) @@ | ||
532 | } |
|
533 | } |
|
534 | ||
535 | public static function startsWith($value, $prefix, $message = '') |
|
536 | { |
|
537 | if (0 !== strpos($value, $prefix)) { |
|
538 | static::reportInvalidArgument(sprintf( |
|
539 | $message ?: 'Expected a value to start with %2$s. Got: %s', |
|
540 | static::valueToString($value), |
|
541 | static::valueToString($prefix) |
|
542 | )); |
|
543 | } |
|
544 | } |
|
545 | ||
546 | public static function startsWithLetter($value, $message = '') |
|
547 | { |