Skip to content

Type the Connector family with all 22 children. - #1983

Open
shadyvb wants to merge 1 commit into
ticket/XWPENG-47-typed-props-classesfrom
ticket/XWPENG-47-typed-props-connectors
Open

Type the Connector family with all 22 children.#1983
shadyvb wants to merge 1 commit into
ticket/XWPENG-47-typed-props-classesfrom
ticket/XWPENG-47-typed-props-connectors

Conversation

@shadyvb

@shadyvb shadyvb commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Part of XWPENG-47 — typed properties rollout for PHP 8.2+.

Adds native PHP type declarations to the Connector abstract base and all 22 built-in connector children so property contracts are enforced at runtime and redundant @var docblocks can be removed.

Approach

  • Typed every assignable property on Connector: string $name, array $actions / $delayed, ?int $prev_stream, bool $register_admin / $register_frontend, and private bool $is_registered.
  • Normalized $name default from null to '' so the string type is valid without coercion.
  • Applied matching typed declarations across all 22 files in connectors/ (e.g. Connector_Settings also types $labels, $permalink_options, and $network_options).
  • Updated the inline test double in Connector_Test to use the new typed properties.
  • Removed classes/class-connector.php and connectors/ from the Rector skip list now that the family is fully typed; alert and exporter families remain skipped for a follow-up PR.

No behavior changes — this is a static-analysis and type-safety pass only.

Checklist

  • Project documentation has been updated to reflect the changes in this pull request, if applicable.
  • I have tested the changes in the local development environment (see contributing.md).
  • I have added phpunit tests.

Release Changelog

  • N/A — internal refactor stacked under XWPENG-47; not targeting master directly.

Release Checklist

  • This pull request is to the master branch.
  • Release version follows semantic versioning. Does it include breaking changes?
  • Update changelog in readme.txt.
  • Bump version in stream.php.
  • Bump Stable tag in readme.txt.
  • Bump version in classes/class-plugin.php.
  • Draft a release on GitHub.

Change [ ] to [x] to mark the items as done.

@shadyvb
shadyvb marked this pull request as ready for review September 2, 2026 10:10
@shadyvb
shadyvb force-pushed the ticket/XWPENG-47-typed-props-connectors branch from bbf96d2 to e067c30 Compare September 2, 2026 10:12
Rector plus hand invariance alignment so parent and child property types match.
Connector::$name is string (non-nullable) on the base and every child.
@shadyvb
shadyvb force-pushed the ticket/XWPENG-47-typed-props-connectors branch from e067c30 to 49cde6b Compare September 2, 2026 14:30
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.

1 participant