laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 31 forks source link

PHPDoc for Str::replace() #2623

Closed MaRmARk0 closed 3 years ago

MaRmARk0 commented 3 years ago

Just a quick note that Str::replace() in Laravel v8.12 has @return static which obviously should be @return string, or even better @return array|string|string[]. PhpStorm is raging about it. :)

    /**
     * Replace the given value in the given string.
     *
     * @param  string|string[]  $search
     * @param  string|string[]  $replace
     * @param  string|string[]  $subject
     * @return static
     */
    public static function replace($search, $replace, $subject)
    {
        return str_replace($search, $replace, $subject);
    }
themsaid commented 3 years ago

this is fixed now