Skip to content

fix: remediate phpstan errors#149

Open
justlevine wants to merge 1 commit intoscaffold-eslint-fixesfrom
scaffold-phpstan-errors
Open

fix: remediate phpstan errors#149
justlevine wants to merge 1 commit intoscaffold-eslint-fixesfrom
scaffold-phpstan-errors

Conversation

@justlevine
Copy link
Collaborator

Description

Fixes PHPStan errors in the repo.

Important

This PR is based on #148 which should be merged first.
Relevant diff: 104f525

Technical Details

OpenCode Promt

Review, make a plan, and remediate all PHPStan errors in this repo. If you need to create any stubfiles, create them in `phpstan/stubs`. ulw

Checklist

Screenshots

To-do

Fixes/Covers issue

Fixes #

@justlevine justlevine force-pushed the scaffold-phpstan-errors branch from 104f525 to 9128827 Compare March 6, 2026 01:14
@justlevine justlevine force-pushed the scaffold-phpstan-errors branch from 9128827 to 8505ddd Compare March 6, 2026 01:25
@justlevine justlevine changed the base branch from develop to scaffold-eslint-fixes March 6, 2026 02:04
@justlevine justlevine requested a review from Copilot March 6, 2026 02:05
Copy link
Contributor

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 addresses PHPStan analysis issues by adding WordPress stub definitions for OneSearch-specific dynamic properties and by fixing a typed-property initialization issue in the Search module.

Changes:

  • Added a PHPStan stub file extending WP_Query / WP_Post with OneSearch dynamic properties.
  • Registered the new stub file in phpstan.neon.dist.
  • Initialized Search::$is_search_enabled to null to avoid uninitialized typed-property problems.

Reviewed changes

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

File Description
phpstan/stubs/wordpress-extended.php Adds PHPStan-only declarations for OneSearch dynamic properties on WP core types.
phpstan.neon.dist Loads the new stub file during PHPStan analysis.
inc/Modules/Search/Search.php Ensures nullable typed property is initialized to prevent uninitialized-property errors.

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

You can also share your feedback on Copilot code review. Take the survey.

@justlevine justlevine requested a review from up1512001 March 6, 2026 02:09
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