File tree Expand file tree Collapse file tree 4 files changed +47
-8
lines changed
Expand file tree Collapse file tree 4 files changed +47
-8
lines changed Original file line number Diff line number Diff line change @@ -158,14 +158,18 @@ public static function createWithHttpClient(
158158 ClientInterface $ httpClient ,
159159 RequestFactoryInterface $ requestFactory ,
160160 StreamFactoryInterface $ streamFactory ,
161- string $ baseUrl ,
162- #[\SensitiveParameter]
163- string $ secret ,
161+ UrlBuilder $ urlBuilder ,
164162 ): static {
165163 // Extending classes need to override this method, if they change the
166164 // constructor signature.
167165 // @phpstan-ignore new.static
168- $ instance = new static ($ baseUrl , $ secret );
166+ $ instance = new static (
167+ // The current version of the constructor does not support injecting
168+ // A UrlBuilder instance. As a stop-gap, extract the relevant values
169+ // so that a new instance will be created in the constructor.
170+ $ urlBuilder ->getBaseUrl (),
171+ $ urlBuilder ->getSecret (),
172+ );
169173 $ instance ->httpClient = $ httpClient ;
170174 $ instance ->requestFactory = $ requestFactory ;
171175 $ instance ->streamFactory = $ streamFactory ;
Original file line number Diff line number Diff line change @@ -68,6 +68,19 @@ public function setSecret(
6868 return $ this ;
6969 }
7070
71+ /**
72+ * Gets the secret.
73+ *
74+ * This method only exists to support a deprecated property in the
75+ * BigBlueButton class.
76+ *
77+ * @internal
78+ */
79+ public function getSecret (): string
80+ {
81+ return $ this ->secret ;
82+ }
83+
7184 public function setBaseUrl (string $ baseUrl ): self
7285 {
7386 // add tailing dir-separator if missing
@@ -80,6 +93,19 @@ public function setBaseUrl(string $baseUrl): self
8093 return $ this ;
8194 }
8295
96+ /**
97+ * Gets the base url.
98+ *
99+ * This method only exists to support a deprecated property in the
100+ * BigBlueButton class.
101+ *
102+ * @internal
103+ */
104+ public function getBaseUrl (): string
105+ {
106+ return $ this ->baseUrl ;
107+ }
108+
83109 public function setHashingAlgorithm (HashingAlgorithm $ hashingAlgorithm ): self
84110 {
85111 $ this ->hashingAlgorithm = $ hashingAlgorithm ;
Original file line number Diff line number Diff line change 2020
2121namespace BigBlueButton ;
2222
23+ use BigBlueButton \Enum \HashingAlgorithm ;
24+ use BigBlueButton \Util \UrlBuilder ;
2325use GuzzleHttp \Client ;
2426use GuzzleHttp \Psr7 \HttpFactory ;
2527
@@ -46,8 +48,11 @@ public function setUp(): void
4648 $ client ,
4749 $ factory ,
4850 $ factory ,
49- getenv ('BBB_SERVER_BASE_URL ' ) ?: $ this ->fail (),
50- getenv ('BBB_SECRET ' ) ?: getenv ('BBB_SECURITY_SALT ' ) ?: $ this ->fail (),
51+ new UrlBuilder (
52+ getenv ('BBB_SECRET ' ) ?: getenv ('BBB_SECURITY_SALT ' ) ?: $ this ->fail (),
53+ getenv ('BBB_SERVER_BASE_URL ' ) ?: $ this ->fail (),
54+ HashingAlgorithm::SHA_256 ,
55+ ),
5156 );
5257 }
5358}
Original file line number Diff line number Diff line change 2121namespace BigBlueButton \Util ;
2222
2323use BigBlueButton \BigBlueButton ;
24+ use BigBlueButton \Enum \HashingAlgorithm ;
2425use GuzzleHttp \Client ;
2526use GuzzleHttp \Psr7 \HttpFactory ;
2627
@@ -40,8 +41,11 @@ public function setUp(): void
4041 $ client ,
4142 $ factory ,
4243 $ factory ,
43- getenv ('BBB_SERVER_BASE_URL ' ) ?: $ this ->fail (),
44- getenv ('BBB_SECRET ' ) ?: getenv ('BBB_SECURITY_SALT ' ) ?: $ this ->fail (),
44+ new UrlBuilder (
45+ getenv ('BBB_SECRET ' ) ?: getenv ('BBB_SECURITY_SALT ' ) ?: $ this ->fail (),
46+ getenv ('BBB_SERVER_BASE_URL ' ) ?: $ this ->fail (),
47+ HashingAlgorithm::SHA_256 ,
48+ ),
4549 );
4650
4751 parent ::setUp ();
You can’t perform that action at this time.
0 commit comments