Code Duplication    Length = 10-10 lines in 3 locations

src/Assert.php 3 locations

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