Skip to content

Add PHP 8.4 compatibility changes #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add PHP 8.4 compatibility changes #211

wants to merge 5 commits into from

Conversation

JPry
Copy link

@JPry JPry commented Apr 23, 2025

When running slic with PHP 8.4, I noticed the following notices:

❯ slic use the-events-calendar 

Deprecated: StellarWP\Slic\args(): Implicitly marking parameter $source as nullable is deprecated, the explicit nullable type must be used instead in /Users/jpry/projects/slic/src/utils.php on line 22

Call Stack:
    0.0001     398368   1. {main}() /Users/jpry/.composer/bin/slic:0
    0.0006     398784   2. {closure:/Users/jpry/.composer/bin/slic:4-14}() /Users/jpry/.composer/bin/slic:14
    0.0011     424440   3. require_once('/Users/jpry/projects/slic/slic.php') /Users/jpry/.composer/bin/slic:13


Deprecated: StellarWP\Slic\check_status_or(): Implicitly marking parameter $else as nullable is deprecated, the explicit nullable type must be used instead in /Users/jpry/projects/slic/src/process.php on line 240

Call Stack:
    0.0001     398368   1. {main}() /Users/jpry/.composer/bin/slic:0
    0.0006     398784   2. {closure:/Users/jpry/.composer/bin/slic:4-14}() /Users/jpry/.composer/bin/slic:14
    0.0011     424440   3. require_once('/Users/jpry/projects/slic/slic.php') /Users/jpry/.composer/bin/slic:13
    0.0047     526440   4. require_once('/Users/jpry/projects/slic/src/utils.php') /Users/jpry/projects/slic/slic.php:6


Deprecated: StellarWP\Slic\ensure_wordpress_ready(): Implicitly marking parameter $version as nullable is deprecated, the explicit nullable type must be used instead in /Users/jpry/projects/slic/src/wordpress.php on line 154

Call Stack:
    0.0001     398368   1. {main}() /Users/jpry/.composer/bin/slic:0
    0.0006     398784   2. {closure:/Users/jpry/.composer/bin/slic:4-14}() /Users/jpry/.composer/bin/slic:14
    0.0011     424440   3. require_once('/Users/jpry/projects/slic/slic.php') /Users/jpry/.composer/bin/slic:13

slic version 1.9.1 - StellarWP local testing and development tool

Using the-events-calendar

This PR resolves these particular deprecated notices, and handles a few other small tweaks:

  1. Replaces a ternary operator with ??.
  2. Import Closure instead of using the leading backslash
  3. Remove an unused parameter (related to the last deprecation notice)

@JPry JPry self-assigned this Apr 23, 2025
@Camwyn Camwyn requested a review from lucatume April 24, 2025 14:23
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.

2 participants