Skip to content

Commit

Permalink
Fix php8.4 deprecations and add CI versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Mar 15, 2024
1 parent 02b8774 commit 28fb502
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"

steps:
- name: "Checkout"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
php-version:
- "7.2"
- "8.1"
- "8.3"

steps:
- name: "Checkout"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
php-version:
- "7.2"
- "8.1"
- "8.3"

steps:
- name: "Checkout"
Expand Down
6 changes: 3 additions & 3 deletions src/Preg.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static function matchAllWithOffsets(string $pattern, string $subject, ?ar
*
* @param-out int<0, max> $count
*/
public static function replace($pattern, $replacement, $subject, int $limit = -1, int &$count = null): string
public static function replace($pattern, $replacement, $subject, int $limit = -1, ?int &$count = null): string
{
if (!is_scalar($subject)) {
if (is_array($subject)) {
Expand All @@ -174,7 +174,7 @@ public static function replace($pattern, $replacement, $subject, int $limit = -1
*
* @param-out int<0, max> $count
*/
public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, int &$count = null, int $flags = 0): string
public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string
{
if (!is_scalar($subject)) {
if (is_array($subject)) {
Expand Down Expand Up @@ -204,7 +204,7 @@ public static function replaceCallback($pattern, callable $replacement, $subject
*
* @param-out int<0, max> $count
*/
public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, int &$count = null, int $flags = 0): string
public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string
{
if (!is_scalar($subject)) {
if (is_array($subject)) {
Expand Down

1 comment on commit 28fb502

@Seldaek
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @Ayesh just so you know I am on the php8.4 deprecations in this repo (and I've fixed composer/ca-bundle), but I'm waiting for a phpstan patch release before I wrap things up.

Please sign in to comment.