Skip to content

Keep $clientID as deprecated alias alongside renamed $clientId#35

Merged
Subterrane merged 4 commits into
masterfrom
copilot/fix-code-review-suggestion
Jun 9, 2026
Merged

Keep $clientID as deprecated alias alongside renamed $clientId#35
Subterrane merged 4 commits into
masterfrom
copilot/fix-code-review-suggestion

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

PR #34 renames the public $clientID property to $clientId to fix PHP 8.2+ dynamic property deprecation, but silently breaks consumers accessing $client->clientID directly.

Changes

  • src/OneLoginClient.php: Explicitly declare both $clientId (primary) and $clientID (deprecated alias), and assign both in the constructor to keep them in sync
  • src/exceptions/OneLoginException.php: Make $previous parameter explicitly nullable (?\Throwable) to fix PHP 8.4 implicit nullable deprecation
/** @var string $clientId OneLogin Client ID */
public $clientId;

/** @deprecated Use $clientId instead */
public $clientID;

public function __construct(...)
{
    $this->clientId = $clientId;
    $this->clientID = $clientId; // deprecated alias, kept in sync
    ...
}

Copilot AI changed the title [WIP] Fix code based on review comment Keep $clientID as deprecated alias alongside renamed $clientId Jun 9, 2026
Copilot AI requested a review from Subterrane June 9, 2026 13:03
@Subterrane Subterrane marked this pull request as ready for review June 9, 2026 13:23
@Subterrane Subterrane requested a review from Copilot June 9, 2026 13:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 restores backward compatibility after renaming the public OneLoginClient::$clientID property to ::$clientId (to avoid PHP 8.2+ dynamic property deprecations), and updates exception typing to avoid PHP 8.4 implicit-nullable deprecations.

Changes:

  • Declare public $clientId while retaining public $clientID as a deprecated alias.
  • Initialize the deprecated alias in the OneLoginClient constructor.
  • Make OneLoginException’s $previous parameter explicitly nullable (?\Throwable).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/OneLoginClient.php Adds the new clientId property and keeps clientID as a deprecated alias initialized in the constructor.
src/exceptions/OneLoginException.php Updates constructor signature to use ?\Throwable $previous = null for PHP 8.4 compatibility.

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

Comment thread src/OneLoginClient.php
Comment thread src/OneLoginClient.php Outdated
Comment thread src/OneLoginClient.php Outdated
Subterrane and others added 2 commits June 9, 2026 06:33
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Subterrane Subterrane merged commit 61fd9d2 into master Jun 9, 2026
3 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.

3 participants