Skip to content

Inject UrlBuilder instance into the BigBlueButton constructor #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

donquixote
Copy link

For now I am proposing a version that does not break BC.

$this->hashingAlgorithm = $hashingAlgorithm;
$this->bbbBaseUrl = $urlBuilder->getBaseUrl();
$this->bbbSecret = $urlBuilder->getSecret();
$this->hashingAlgorithm = $urlBuilder->getHashingAlgorithm();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need these getters if we want to fill the deprecated properties.
We can remove all of this in the next major version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, maybe we can leave the properties uninitialized?

Any code that currently uses these properties would do so by extending BigBlueButton.
It is unlikely that the same code would also want to inject a UrlBuilder class.
Unless we are talking about two separate packages.

#[\SensitiveParameter]
?string $secret = null,
?array $opts = [],
?UrlBuilder $urlBuilder = null,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For full BC support, the parameter must be appended. We cannot drop or replace the other parameters.

For a smooth way to the next major version, without disruptive BC breaks, we can (in a follow-up) deprecate the constructor and recommend to use dedicated static factory methods.

// constructor signature.
// @phpstan-ignore new.static
return new static($secret, $baseUrl, $hashingAlgorithm);
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to decide whether the env vars should be still supported in the next major version.
Until that is decided, this static factory can remain @internal.

$hashingAlgorithm = HashingAlgorithm::SHA_256;
public function __construct(
?string $baseUrl = null,
#[\SensitiveParameter]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #[SensitiveParameter] is from a different PR, which we should do first:

@donquixote donquixote force-pushed the inject-url-builder branch from 650b543 to 0b73ff4 Compare June 16, 2025 14:16
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