Skip to content

Remove return statement in PubSubHttpClient constructor - #234

Open
crynobone wants to merge 1 commit into
ably:mainfrom
crynobone:patch-1
Open

crynobone wants to merge 1 commit into
ably:mainfrom
crynobone:patch-1

Conversation

@crynobone

@crynobone crynobone commented Nov 10, 2026 •

Copy link
Copy Markdown

In PHP class constructor should return void as per manual https://www.php.net/manual/en/language.oop5.decon.php and using return $this; will start to output warning in PHP 8.6

1) /home/runner/work/framework/framework/vendor/ably/pubsub-server/src/PubSubHttpClient.php:110
Returning a value from a constructor is deprecated

Triggered by:

* Illuminate\Tests\Broadcasting\Ably2BroadcasterTest::testAuthCallValidAuthenticationResponseWithPrivateChannelWhenCallbackReturnTrue
  /home/runner/work/framework/framework/tests/Broadcasting/Ably2BroadcasterTest.php:32

Summary by CodeRabbit

  • Refactor
    • Simplified client initialization without changing its public behavior.

In PHP class constructor should return `void` as per manual https://www.php.net/manual/en/language.oop5.decon.php and using `return $this;` will start to output warning in PHP 8.6

```
1) /home/runner/work/framework/framework/vendor/ably/pubsub-server/src/PubSubHttpClient.php:110
Returning a value from a constructor is deprecated

Triggered by:

* Illuminate\Tests\Broadcasting\Ably2BroadcasterTest::testAuthCallValidAuthenticationResponseWithPrivateChannelWhenCallbackReturnTrue
  /home/runner/work/framework/framework/tests/Broadcasting/Ably2BroadcasterTest.php:32
```
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The constructor no longer explicitly returns $this after initializing the client.

Changes

Constructor cleanup

Layer / File(s) Summary
Constructor initialization
src/PubSubHttpClient.php
The constructor ends after initialization without an explicit return $this.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Merge Risk: Minimal · up to 1eba1

This removes a deprecated constructor return statement and fixes the PHP 8.6 warning without changing runtime behavior. The change is safe to merge.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly states the main change: removing the return statement from the PubSubHttpClient constructor.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit hops past the client’s door
The constructor returns no more
It sets things up, then ends its part
One line removed, a tidy start
The rabbit nibbles, pleased and keen

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3af0da9a-dfd7-4f21-bb85-b453b56ecadf
Commits

Reviewing files that changed from the base of the PR and between ae2b075 and 1eba14b.

Files selected for processing: 1

  • src/PubSubHttpClient.php
Files with no reviewable changes: 1

  • src/PubSubHttpClient.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant