Code Duplication    Length = 10-10 lines in 3 locations

src/Assert.php 3 locations

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