Code Duplication    Length = 10-10 lines in 3 locations

src/Assert.php 3 locations

@@ 1066-1075 (lines=10) @@
1063
     *
1064
     * @throws InvalidArgumentException
1065
     */
1066
    public static function contains($value, $subString, $message = '')
1067
    {
1068
        if (false === \strpos($value, $subString)) {
1069
            static::reportInvalidArgument(\sprintf(
1070
                $message ?: 'Expected a value to contain %2$s. Got: %s',
1071
                static::valueToString($value),
1072
                static::valueToString($subString)
1073
            ));
1074
        }
1075
    }
1076
1077
    /**
1078
     * @param mixed  $value
@@ 1084-1093 (lines=10) @@
1081
     *
1082
     * @throws InvalidArgumentException
1083
     */
1084
    public static function notContains($value, $subString, $message = '')
1085
    {
1086
        if (false !== \strpos($value, $subString)) {
1087
            static::reportInvalidArgument(\sprintf(
1088
                $message ?: '%2$s was not expected to be contained in a value. Got: %s',
1089
                static::valueToString($value),
1090
                static::valueToString($subString)
1091
            ));
1092
        }
1093
    }
1094
1095
    /**
1096
     * @param mixed  $value
@@ 1118-1127 (lines=10) @@
1115
     *
1116
     * @throws InvalidArgumentException
1117
     */
1118
    public static function startsWith($value, $prefix, $message = '')
1119
    {
1120
        if (0 !== \strpos($value, $prefix)) {
1121
            static::reportInvalidArgument(\sprintf(
1122
                $message ?: 'Expected a value to start with %2$s. Got: %s',
1123
                static::valueToString($value),
1124
                static::valueToString($prefix)
1125
            ));
1126
        }
1127
    }
1128
1129
    /**
1130
     * @param mixed  $value