Code Duplication    Length = 10-10 lines in 3 locations

src/Assert.php 3 locations

@@ 1147-1156 (lines=10) @@
1144
     *
1145
     * @throws InvalidArgumentException
1146
     */
1147
    public static function contains($value, $subString, $message = '')
1148
    {
1149
        if (false === \strpos($value, $subString)) {
1150
            static::reportInvalidArgument(\sprintf(
1151
                $message ?: 'Expected a value to contain %2$s. Got: %s',
1152
                static::valueToString($value),
1153
                static::valueToString($subString)
1154
            ));
1155
        }
1156
    }
1157
1158
    /**
1159
     * @psalm-pure
@@ 1167-1176 (lines=10) @@
1164
     *
1165
     * @throws InvalidArgumentException
1166
     */
1167
    public static function notContains($value, $subString, $message = '')
1168
    {
1169
        if (false !== \strpos($value, $subString)) {
1170
            static::reportInvalidArgument(\sprintf(
1171
                $message ?: '%2$s was not expected to be contained in a value. Got: %s',
1172
                static::valueToString($value),
1173
                static::valueToString($subString)
1174
            ));
1175
        }
1176
    }
1177
1178
    /**
1179
     * @psalm-pure
@@ 1205-1214 (lines=10) @@
1202
     *
1203
     * @throws InvalidArgumentException
1204
     */
1205
    public static function startsWith($value, $prefix, $message = '')
1206
    {
1207
        if (0 !== \strpos($value, $prefix)) {
1208
            static::reportInvalidArgument(\sprintf(
1209
                $message ?: 'Expected a value to start with %2$s. Got: %s',
1210
                static::valueToString($value),
1211
                static::valueToString($prefix)
1212
            ));
1213
        }
1214
    }
1215
1216
    /**
1217
     * @psalm-pure