Skip to content

Conversation

@Icegreeen
Copy link

Fix

Made Components\Actor extend Operations\Actor.
This way, both classes work in the constructor without breaking compatibility.

Validation

php -r 'require "vendor/autoload.php"; $a=new \Clerk\Backend\Models\Components\Actor(); $a->sub="user_123"; $b=new \Clerk\Backend\Models\Operations\CreateActorTokenRequestBody("user_123",$a); echo json_encode($b);'

Captura de tela 2025-09-20 012159

Output after fix:

{"userId":"user_123","actor":{"sub":"user_123","additionalProperties":null},"expiresInSeconds":3600,"sessionMaxDurationInSeconds":1800}

The bug only occurs if a developer imports Components\Actor instead of Operations\Actor. However, since both classes exist with the same name, it’s easy to make this mistake even for experienced developers (autocomplete/IDE often suggests Components fo example). The result is a fatal runtime error, this PR eliminates that pitfall with a minimal and backwards-compatible change.

@Icegreeen
Copy link
Author

Icegreeen commented Sep 20, 2025

The last commit fixed a syntax error because -> can only be used on object instances, not on static methods

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