Skip to content

Commit 437371f

Browse files
authored
Update StrWrp.php
1 parent 8aaf902 commit 437371f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/StrWrp.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function count(): int
4141
* @param int|null $length
4242
* @return StrWrp
4343
*/
44-
public function slice(int $pos, int $length = null): StrWrp
44+
public function slice(int $pos, ?int $length = null): StrWrp
4545
{
4646
$copy = clone $this;
4747
$copy->value = $this->multibyte ?
@@ -145,7 +145,7 @@ public function isDate(): bool
145145
* @return \DateTimeInterface
146146
* @throws \Exception
147147
*/
148-
public function toDate(\DateTimeZone $tz = null): \DateTimeInterface
148+
public function toDate(?\DateTimeZone $tz = null): \DateTimeInterface
149149
{
150150
return new \DateTimeImmutable($this->value, $tz);
151151
}
@@ -524,7 +524,7 @@ public function end(int $length, bool $remove = false): StrWrp
524524
* @param int|null $count
525525
* @return StrWrp
526526
*/
527-
public function pregReplace(string|array $pattern, string|array $replacement, int $limit = -1, int &$count = null): StrWrp
527+
public function pregReplace(string|array $pattern, string|array $replacement, int $limit = -1, ?int &$count = null): StrWrp
528528
{
529529
$copy = clone $this;
530530
$copy->value = preg_replace($pattern, $replacement, $this->value, $limit, $count);
@@ -659,7 +659,7 @@ public function dasherize(): StrWrp
659659
* @param int|null $length
660660
* @return int
661661
*/
662-
public function substrCount(string $needle, int $offset = 0, int $length = null): int
662+
public function substrCount(string $needle, int $offset = 0, ?int $length = null): int
663663
{
664664
return substr_count($this->value, $needle, $offset, $length);
665665
}

0 commit comments

Comments
 (0)