Code Duplication    Length = 10-10 lines in 3 locations

src/Assert.php 3 locations

@@ 973-982 (lines=10) @@
970
     *
971
     * @throws InvalidArgumentException
972
     */
973
    public static function contains($value, $subString, $message = '')
974
    {
975
        if (false === \strpos($value, $subString)) {
976
            static::reportInvalidArgument(\sprintf(
977
                $message ?: 'Expected a value to contain %2$s. Got: %s',
978
                static::valueToString($value),
979
                static::valueToString($subString)
980
            ));
981
        }
982
    }
983
984
    /**
985
     * @param mixed  $value
@@ 991-1000 (lines=10) @@
988
     *
989
     * @throws InvalidArgumentException
990
     */
991
    public static function notContains($value, $subString, $message = '')
992
    {
993
        if (false !== \strpos($value, $subString)) {
994
            static::reportInvalidArgument(\sprintf(
995
                $message ?: '%2$s was not expected to be contained in a value. Got: %s',
996
                static::valueToString($value),
997
                static::valueToString($subString)
998
            ));
999
        }
1000
    }
1001
1002
    /**
1003
     * @param mixed  $value
@@ 1025-1034 (lines=10) @@
1022
     *
1023
     * @throws InvalidArgumentException
1024
     */
1025
    public static function startsWith($value, $prefix, $message = '')
1026
    {
1027
        if (0 !== \strpos($value, $prefix)) {
1028
            static::reportInvalidArgument(\sprintf(
1029
                $message ?: 'Expected a value to start with %2$s. Got: %s',
1030
                static::valueToString($value),
1031
                static::valueToString($prefix)
1032
            ));
1033
        }
1034
    }
1035
1036
    /**
1037
     * @param mixed  $value