Skip to content

Add Requires header fields and fix implicit-nullable deprecations - #7

Merged
torounit merged 1 commit into
mainfrom
fix/plugin-header-and-deprecations
Jun 18, 2026
Merged

torounit merged 1 commit into
mainfrom
fix/plugin-header-and-deprecations

Conversation

@torounit

Copy link
Copy Markdown
Owner

Summary

  • Add Requires at least: 6.7 / Requires PHP: 8.2 to the plugin header in schedule-terms.php, matching what's already documented in README.md.
  • Explicitly mark Term_Manager::__construct()'s $time parameter and Term\UI::add_column_value()'s $column_value / $custom_column parameters as nullable (?int / ?string), resolving the PHP 8.4+ "implicitly marking parameter as nullable is deprecated" warnings surfaced by composer lint.

Test plan

  • composer lint no longer prints any Deprecated: output
  • npm run test:php (PHPUnit via wp-env) passes

…tions

Add "Requires at least" / "Requires PHP" to the plugin header to match
the versions already documented in README.md. Also explicitly mark
Term_Manager::__construct()'s $time and Term\UI::add_column_value()'s
$column_value / $custom_column parameters as nullable, since PHP 8.4+
deprecates relying on a "= null" default to imply a nullable type.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds WordPress/PHP compatibility metadata to the plugin header and resolves PHP 8.4+ “implicit nullable” deprecation warnings by making affected parameters explicitly nullable.

Changes:

  • Add Requires at least: 6.7 and Requires PHP: 8.2 to the plugin header in schedule-terms.php.
  • Update Term_Manager::__construct() to use ?int $time = null.
  • Update Term\UI::add_column_value() to use ?string parameters and adjust related docblocks.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
schedule-terms.php Adds WordPress/PHP minimum version requirements to the plugin header.
includes/Term/UI.php Makes custom column callback parameters explicitly nullable to avoid implicit-nullable deprecations.
includes/Term_Manager.php Makes $time explicitly nullable (?int) to avoid implicit-nullable deprecations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/Term/UI.php
Comment on lines 232 to +234
* @return string|void
*/
public function add_column_value( string $column_value = null, string $custom_column = null, int $term_id = 0 ) {
public function add_column_value( ?string $column_value = null, ?string $custom_column = null, int $term_id = 0 ) {
@torounit
torounit merged commit 8b0e3f5 into main Jun 18, 2026
10 checks passed
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.

PHP8.0以下の環境での「重大なエラーが発生」

2 participants