@@ -1941,7 +1941,7 @@ public static function createFromObjectVars($object): self
19411941 * @phpstan-return static<int,string>
19421942 * @psalm-mutation-free
19431943 */
1944- public static function createFromString (string $ str , string $ delimiter = null , string $ regEx = null ): self
1944+ public static function createFromString (string $ str , ? string $ delimiter = null , ? string $ regEx = null ): self
19451945 {
19461946 if ($ regEx ) {
19471947 \preg_match_all ($ regEx , $ str , $ array );
@@ -2648,7 +2648,7 @@ public function filter($closure = null, int $flag = \ARRAY_FILTER_USE_BOTH)
26482648 public function filterBy (
26492649 string $ property ,
26502650 $ value ,
2651- string $ comparisonOp = null
2651+ ? string $ comparisonOp = null
26522652 ): self {
26532653 if (!$ comparisonOp ) {
26542654 $ comparisonOp = \is_array ($ value ) ? 'contains ' : 'eq ' ;
@@ -2834,7 +2834,7 @@ public function firstKey()
28342834 * @phpstan-return static<TKey,T>
28352835 * @psalm-mutation-free
28362836 */
2837- public function firstsImmutable (int $ number = null ): self
2837+ public function firstsImmutable (? int $ number = null ): self
28382838 {
28392839 $ arrayTmp = $ this ->toArray ();
28402840
@@ -2863,7 +2863,7 @@ public function firstsImmutable(int $number = null): self
28632863 * @phpstan-return static<array-key,TKey>
28642864 * @psalm-mutation-free
28652865 */
2866- public function firstsKeys (int $ number = null ): self
2866+ public function firstsKeys (? int $ number = null ): self
28672867 {
28682868 $ arrayTmp = $ this ->keys ()->toArray ();
28692869
@@ -2895,7 +2895,7 @@ public function firstsKeys(int $number = null): self
28952895 *
28962896 * @phpstan-return ($number is null ? static<int,T> : static<TKey,T>)
28972897 */
2898- public function firstsMutable (int $ number = null ): self
2898+ public function firstsMutable (? int $ number = null ): self
28992899 {
29002900 $ this ->generatorToArray ();
29012901
@@ -2972,7 +2972,7 @@ public function flip(): self
29722972 public function get (
29732973 $ key = null ,
29742974 $ fallback = null ,
2975- array $ array = null ,
2975+ ? array $ array = null ,
29762976 bool $ useByReference = false
29772977 ) {
29782978 if ($ array === null && $ key === null ) {
@@ -4265,7 +4265,7 @@ public function lastKey()
42654265 * @phpstan-return static<TKey,T>
42664266 * @psalm-mutation-free
42674267 */
4268- public function lastsImmutable (int $ number = null ): self
4268+ public function lastsImmutable (? int $ number = null ): self
42694269 {
42704270 if ($ this ->isEmpty ()) {
42714271 return static ::create (
@@ -4310,7 +4310,7 @@ public function lastsImmutable(int $number = null): self
43104310 *
43114311 * @phpstan-return static<TKey,T>
43124312 */
4313- public function lastsMutable (int $ number = null ): self
4313+ public function lastsMutable (? int $ number = null ): self
43144314 {
43154315 if ($ this ->isEmpty ()) {
43164316 return $ this ;
@@ -4724,7 +4724,7 @@ public function mostUsedValue()
47244724 * @phpstan-return static<array-key,T>
47254725 * @psalm-mutation-free
47264726 */
4727- public function mostUsedValues (int $ number = null ): self
4727+ public function mostUsedValues (? int $ number = null ): self
47284728 {
47294729 return $ this ->countValues ()->arsortImmutable ()->firstsKeys ($ number );
47304730 }
@@ -5230,7 +5230,7 @@ public function push(...$args)
52305230 *
52315231 * @phpstan-return static<array-key,T>
52325232 */
5233- public function randomImmutable (int $ number = null ): self
5233+ public function randomImmutable (? int $ number = null ): self
52345234 {
52355235 $ this ->generatorToArray ();
52365236
@@ -5347,7 +5347,7 @@ public function randomKeys(int $number): self
53475347 *
53485348 * @phpstan-return static<TKey,T>
53495349 */
5350- public function randomMutable (int $ number = null ): self
5350+ public function randomMutable (? int $ number = null ): self
53515351 {
53525352 $ this ->generatorToArray ();
53535353
@@ -5429,7 +5429,7 @@ public function randomValues(int $number): self
54295429 * @phpstan-param array<(int&T)|(string&T),int> $array
54305430 * @phpstan-return static<array-key,T>
54315431 */
5432- public function randomWeighted (array $ array , int $ number = null ): self
5432+ public function randomWeighted (array $ array , ? int $ number = null ): self
54335433 {
54345434 // init
54355435 $ options = [];
@@ -6248,7 +6248,7 @@ public function shift()
62486248 * @phpstan-param array<TKey,T> $array
62496249 * @phpstan-return static<TKey,T>
62506250 */
6251- public function shuffle (bool $ secure = false , array $ array = null ): self
6251+ public function shuffle (bool $ secure = false , ? array $ array = null ): self
62526252 {
62536253 if ($ array === null ) {
62546254 $ array = $ this ->toArray (false );
@@ -6454,7 +6454,7 @@ public function sizeRecursive(): int
64546454 * @phpstan-return static<array-key,T>
64556455 * @psalm-mutation-free
64566456 */
6457- public function slice (int $ offset , int $ length = null , bool $ preserveKeys = false )
6457+ public function slice (int $ offset , ? int $ length = null , bool $ preserveKeys = false )
64586458 {
64596459 return static ::create (
64606460 \array_slice (
@@ -6719,7 +6719,7 @@ static function ($value) use ($sorter) {
67196719 * @phpstan-return static<TKey,T>
67206720 * @psalm-mutation-free
67216721 */
6722- public function splice (int $ offset , int $ length = null , $ replacement = []): self
6722+ public function splice (int $ offset , ? int $ length = null , $ replacement = []): self
67236723 {
67246724 $ tmpArray = $ this ->toArray ();
67256725
@@ -6967,7 +6967,7 @@ public function toJson(int $options = 0, int $depth = 512): string
69676967 *
69686968 * @phpstan-return static<int, static<TKey,T>>
69696969 */
6970- public function toPermutation (array $ items = null , array $ helper = []): self
6970+ public function toPermutation (? array $ items = null , array $ helper = []): self
69716971 {
69726972 // init
69736973 $ return = [];
0 commit comments