@@ -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