Code Duplication    Length = 10-10 lines in 3 locations

src/Assert.php 3 locations

@@ 996-1005 (lines=10) @@
993
     *
994
     * @throws InvalidArgumentException
995
     */
996
    public static function contains($value, $subString, $message = '')
997
    {
998
        if (false === \strpos($value, $subString)) {
999
            static::reportInvalidArgument(\sprintf(
1000
                $message ?: 'Expected a value to contain %2$s. Got: %s',
1001
                static::valueToString($value),
1002
                static::valueToString($subString)
1003
            ));
1004
        }
1005
    }
1006
1007
    /**
1008
     * @param mixed  $value
@@ 1014-1023 (lines=10) @@
1011
     *
1012
     * @throws InvalidArgumentException
1013
     */
1014
    public static function notContains($value, $subString, $message = '')
1015
    {
1016
        if (false !== \strpos($value, $subString)) {
1017
            static::reportInvalidArgument(\sprintf(
1018
                $message ?: '%2$s was not expected to be contained in a value. Got: %s',
1019
                static::valueToString($value),
1020
                static::valueToString($subString)
1021
            ));
1022
        }
1023
    }
1024
1025
    /**
1026
     * @param mixed  $value
@@ 1048-1057 (lines=10) @@
1045
     *
1046
     * @throws InvalidArgumentException
1047
     */
1048
    public static function startsWith($value, $prefix, $message = '')
1049
    {
1050
        if (0 !== \strpos($value, $prefix)) {
1051
            static::reportInvalidArgument(\sprintf(
1052
                $message ?: 'Expected a value to start with %2$s. Got: %s',
1053
                static::valueToString($value),
1054
                static::valueToString($prefix)
1055
            ));
1056
        }
1057
    }
1058
1059
    /**
1060
     * @param mixed  $value