Skip to content

Fix 8.4 deprecations #284

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

Merged
merged 1 commit into from
Jul 29, 2025
Merged

Fix 8.4 deprecations #284

merged 1 commit into from
Jul 29, 2025

Conversation

zuuperman
Copy link

Fixes deprecation errors that you receive when using php 8.4

Example:
ERROR: PhpSchool\CliMenu\MenuStyle::setBorder(): Implicitly marking parameter $colour as nullable is deprecated, the explicit nullable type must be used instead

@AydinHassan AydinHassan requested a review from Copilot July 29, 2025 13:27
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes PHP 8.4 deprecation warnings by explicitly marking nullable parameters with the ? type declaration syntax instead of relying on implicit nullability from default null values.

  • Updates method signatures to use explicit nullable types (?string, ?int, ?Terminal, ?MenuStyle)
  • Maintains backward compatibility while adhering to PHP 8.4 requirements
  • Affects constructor parameters, method parameters with optional null defaults

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Util/ColourUtil.php Updates validateColour method to use explicit nullable string parameter
src/MenuStyle.php Updates constructor and multiple methods to use explicit nullable parameters
src/Dialogue/Dialogue.php Updates write method to use explicit nullable int parameter
src/CliMenu.php Updates constructor and dialogue methods to use explicit nullable parameters
src/Builder/SplitItemBuilder.php Updates enableAutoShortcuts method to use explicit nullable string parameter
src/Builder/CliMenuBuilder.php Updates constructor and multiple styling methods to use explicit nullable parameters

@AydinHassan AydinHassan merged commit 328e64a into php-school:master Jul 29, 2025
@AydinHassan
Copy link
Member

AydinHassan commented Jul 29, 2025

Thanks @zuuperman !

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