Code Duplication    Length = 10-10 lines in 3 locations

src/Assert.php 3 locations

@@ 1131-1140 (lines=10) @@
1128
     *
1129
     * @throws InvalidArgumentException
1130
     */
1131
    public static function contains($value, $subString, $message = '')
1132
    {
1133
        if (false === \strpos($value, $subString)) {
1134
            static::reportInvalidArgument(\sprintf(
1135
                $message ?: 'Expected a value to contain %2$s. Got: %s',
1136
                static::valueToString($value),
1137
                static::valueToString($subString)
1138
            ));
1139
        }
1140
    }
1141
1142
    /**
1143
     * @psalm-pure
@@ 1151-1160 (lines=10) @@
1148
     *
1149
     * @throws InvalidArgumentException
1150
     */
1151
    public static function notContains($value, $subString, $message = '')
1152
    {
1153
        if (false !== \strpos($value, $subString)) {
1154
            static::reportInvalidArgument(\sprintf(
1155
                $message ?: '%2$s was not expected to be contained in a value. Got: %s',
1156
                static::valueToString($value),
1157
                static::valueToString($subString)
1158
            ));
1159
        }
1160
    }
1161
1162
    /**
1163
     * @psalm-pure
@@ 1189-1198 (lines=10) @@
1186
     *
1187
     * @throws InvalidArgumentException
1188
     */
1189
    public static function startsWith($value, $prefix, $message = '')
1190
    {
1191
        if (0 !== \strpos($value, $prefix)) {
1192
            static::reportInvalidArgument(\sprintf(
1193
                $message ?: 'Expected a value to start with %2$s. Got: %s',
1194
                static::valueToString($value),
1195
                static::valueToString($prefix)
1196
            ));
1197
        }
1198
    }
1199
1200
    /**
1201
     * @psalm-pure