-
Notifications
You must be signed in to change notification settings - Fork 202
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
base: develop
Are you sure you want to change the base?
Conversation
$this->hashingAlgorithm = $hashingAlgorithm; | ||
$this->bbbBaseUrl = $urlBuilder->getBaseUrl(); | ||
$this->bbbSecret = $urlBuilder->getSecret(); | ||
$this->hashingAlgorithm = $urlBuilder->getHashingAlgorithm(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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); | ||
} |
There was a problem hiding this comment.
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
.
src/BigBlueButton.php
Outdated
$hashingAlgorithm = HashingAlgorithm::SHA_256; | ||
public function __construct( | ||
?string $baseUrl = null, | ||
#[\SensitiveParameter] |
There was a problem hiding this comment.
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:
650b543
to
0b73ff4
Compare
For now I am proposing a version that does not break BC.