@@ 526-535 (lines=10) @@ | ||
523 | } |
|
524 | } |
|
525 | ||
526 | public static function contains($value, $subString, $message = '') |
|
527 | { |
|
528 | if (false === strpos($value, $subString)) { |
|
529 | static::reportInvalidArgument(sprintf( |
|
530 | $message ?: 'Expected a value to contain %2$s. Got: %s', |
|
531 | static::valueToString($value), |
|
532 | static::valueToString($subString) |
|
533 | )); |
|
534 | } |
|
535 | } |
|
536 | ||
537 | public static function notContains($value, $subString, $message = '') |
|
538 | { |
|
@@ 537-546 (lines=10) @@ | ||
534 | } |
|
535 | } |
|
536 | ||
537 | public static function notContains($value, $subString, $message = '') |
|
538 | { |
|
539 | if (false !== strpos($value, $subString)) { |
|
540 | static::reportInvalidArgument(sprintf( |
|
541 | $message ?: '%2$s was not expected to be contained in a value. Got: %s', |
|
542 | static::valueToString($value), |
|
543 | static::valueToString($subString) |
|
544 | )); |
|
545 | } |
|
546 | } |
|
547 | ||
548 | public static function notWhitespaceOnly($value, $message = '') |
|
549 | { |
|
@@ 558-567 (lines=10) @@ | ||
555 | } |
|
556 | } |
|
557 | ||
558 | public static function startsWith($value, $prefix, $message = '') |
|
559 | { |
|
560 | if (0 !== strpos($value, $prefix)) { |
|
561 | static::reportInvalidArgument(sprintf( |
|
562 | $message ?: 'Expected a value to start with %2$s. Got: %s', |
|
563 | static::valueToString($value), |
|
564 | static::valueToString($prefix) |
|
565 | )); |
|
566 | } |
|
567 | } |
|
568 | ||
569 | public static function startsWithLetter($value, $message = '') |
|
570 | { |