Skip to content

Commit a9bc749

Browse files
Fix docblock (#45171)
* fix * fix
1 parent a9bf589 commit a9bc749

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/Illuminate/Support/Stringable.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ public function kebab()
363363
/**
364364
* Return the length of the given string.
365365
*
366-
* @param string $encoding
366+
* @param string|null $encoding
367367
* @return int
368368
*/
369369
public function length($encoding = null)
@@ -502,7 +502,7 @@ public function padRight($length, $pad = ' ')
502502
* Parse a Class@method style callback into class and method.
503503
*
504504
* @param string|null $default
505-
* @return array
505+
* @return array<int, string|null>
506506
*/
507507
public function parseCallback($default = null)
508508
{
@@ -523,7 +523,7 @@ public function pipe(callable $callback)
523523
/**
524524
* Get the plural form of an English word.
525525
*
526-
* @param int $count
526+
* @param int|array|\Countable $count
527527
* @return static
528528
*/
529529
public function plural($count = 2)
@@ -534,7 +534,7 @@ public function plural($count = 2)
534534
/**
535535
* Pluralize the last word of an English, studly caps case string.
536536
*
537-
* @param int $count
537+
* @param int|array|\Countable $count
538538
* @return static
539539
*/
540540
public function pluralStudly($count = 2)
@@ -556,7 +556,7 @@ public function prepend(...$values)
556556
/**
557557
* Remove any occurrence of the given string in the subject.
558558
*
559-
* @param string|array<string> $search
559+
* @param string|iterable<string> $search
560560
* @param bool $caseSensitive
561561
* @return static
562562
*/
@@ -739,11 +739,12 @@ public function singular()
739739
*
740740
* @param string $separator
741741
* @param string|null $language
742+
* @param array<string, string> $dictionary
742743
* @return static
743744
*/
744-
public function slug($separator = '-', $language = 'en')
745+
public function slug($separator = '-', $language = 'en', $dictionary = ['@' => 'at'])
745746
{
746-
return new static(Str::slug($this->value, $separator, $language));
747+
return new static(Str::slug($this->value, $separator, $language, $dictionary));
747748
}
748749

749750
/**
@@ -794,13 +795,13 @@ public function substr($start, $length = null)
794795
* Returns the number of substring occurrences.
795796
*
796797
* @param string $needle
797-
* @param int|null $offset
798+
* @param int $offset
798799
* @param int|null $length
799800
* @return int
800801
*/
801-
public function substrCount($needle, $offset = null, $length = null)
802+
public function substrCount($needle, $offset = 0, $length = null)
802803
{
803-
return Str::substrCount($this->value, $needle, $offset ?? 0, $length);
804+
return Str::substrCount($this->value, $needle, $offset, $length);
804805
}
805806

806807
/**
@@ -1057,11 +1058,12 @@ public function words($words = 100, $end = '...')
10571058
/**
10581059
* Get the number of words a string contains.
10591060
*
1061+
* @param string|null $characters
10601062
* @return int
10611063
*/
1062-
public function wordCount()
1064+
public function wordCount($characters = null)
10631065
{
1064-
return str_word_count($this->value);
1066+
return Str::wordCount($this->value, $characters);
10651067
}
10661068

10671069
/**

0 commit comments

Comments
 (0)