Skip to content

Conversation

@joke2k
Copy link
Contributor

@joke2k joke2k commented Feb 6, 2024

This work aligns the type hinting of the $pattern parameter of the method replaceMatches in Str and Stringable classes, to match what the underneath php functions have:

// https://www.php.net/manual/en/function.preg-replace.php
preg_replace(
    string|array $pattern,
    string|array $replacement,
    string|array $subject,
    int $limit = -1,
    int &$count = null
): string|array|null

// https://www.php.net/manual/en/function.preg-replace-callback.php
preg_replace_callback(
    string|array $pattern,
    [callable](https://www.php.net/manual/en/language.types.callable.php) $callback,
    string|array $subject,
    int $limit = -1,
    int &$count = null,
    int $flags = 0
): string|array|null

@joke2k
Copy link
Contributor Author

joke2k commented Feb 6, 2024

not sure what to do with the failing test in tests / PHP 8.3 - prefer-stable - Windows (pull_request)

Illuminate\Tests\Support\SleepTest::testItSleepsForSecondsWithMilliseconds

@driesvints
Copy link
Member

@joke2k seems like a fluke. Restarted them for ya.

@driesvints driesvints changed the title fix the phpdoc for replaceMatches in Str and Stringable helpers [10.x] Fix the phpdoc for replaceMatches in Str and Stringable helpers Feb 7, 2024
@taylorotwell taylorotwell merged commit f84d681 into laravel:10.x Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants