Skip to content

Commit

Permalink
Issue CollaboraOnline#56: Add php param and return types.
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Nov 12, 2024
1 parent 31bddca commit 09f17b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Cool/CoolRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CoolRequest {
* @throws \Drupal\collabora_online\Exception\CoolRequestException
* The client url cannot be retrieved.
*/
public function getWopiClientURL() {
public function getWopiClientURL(): string {
$_HOST_SCHEME = isset($_SERVER['HTTPS']) ? 'https' : 'http';
$default_config = \Drupal::config('collabora_online.settings');
$wopi_client_server = $default_config->get('cool')['server'];
Expand Down Expand Up @@ -90,7 +90,7 @@ public function getWopiClientURL() {
* @return string|false
* The full contents of discovery.xml, or FALSE on failure.
*/
protected function getDiscovery($server) {
protected function getDiscovery(string $server): string|false {
$discovery_url = $server . '/hosting/discovery';

$default_config = \Drupal::config('collabora_online.settings');
Expand Down Expand Up @@ -136,7 +136,7 @@ protected function getDiscovery($server) {
* WOPI url as configured for this MIME type in discovery.xml, or NULL if
* none was found for the given MIME type.
*/
protected function getWopiSrcUrl($discovery_parsed, $mimetype) {
protected function getWopiSrcUrl(\SimpleXMLElement $discovery_parsed, string $mimetype): string|null {
$result = $discovery_parsed->xpath(sprintf('/wopi-discovery/net-zone/app[@name=\'%s\']/action', $mimetype));
if ($result && count($result) > 0) {
return (string) $result[0]['urlsrc'][0];
Expand Down

0 comments on commit 09f17b8

Please sign in to comment.