Skip to content
Snippets Groups Projects
Commit e3c5c534 authored by NinaHerrmann's avatar NinaHerrmann
Browse files

although having return types is pretty we will remove them for mixed until 7.4 finally drops'

parent e488a6ec
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ class filter_opencast extends moodle_text_filter { ...@@ -42,7 +42,7 @@ class filter_opencast extends moodle_text_filter {
* @param string $attributecontentregex Regex of what the content of the attribute might be. * @param string $attributecontentregex Regex of what the content of the attribute might be.
* @return string|null The content of the attribute or null, if it doesn't exist. * @return string|null The content of the attribute or null, if it doesn't exist.
*/ */
private static function get_attribute(string $tag, string $attributename, string $attributecontentregex = '.*'): string|null { private static function get_attribute(string $tag, string $attributename, string $attributecontentregex = '.*') {
$pattern = "/$attributename=(['\"])($attributecontentregex)\\1/"; $pattern = "/$attributename=(['\"])($attributecontentregex)\\1/";
preg_match($pattern, $tag, $matches); preg_match($pattern, $tag, $matches);
return $matches[2] ?? null; return $matches[2] ?? null;
...@@ -54,7 +54,7 @@ class filter_opencast extends moodle_text_filter { ...@@ -54,7 +54,7 @@ class filter_opencast extends moodle_text_filter {
* @param array $episodeurls array of [ocinstanceid, episoderegex, baseurl]. * @param array $episodeurls array of [ocinstanceid, episoderegex, baseurl].
* @return array|null [ocinstanceid, episodeid] or null if there are no matches. * @return array|null [ocinstanceid, episodeid] or null if there are no matches.
*/ */
private static function test_url(string $url, array $episodeurls) : array|null { private static function test_url(string $url, array $episodeurls) {
foreach ($episodeurls as [$ocinstanceid, $episoderegex, $baseurl]) { foreach ($episodeurls as [$ocinstanceid, $episoderegex, $baseurl]) {
if (preg_match_all($episoderegex, $url, $matches)) { if (preg_match_all($episoderegex, $url, $matches)) {
return [$ocinstanceid, $matches[1][0]]; return [$ocinstanceid, $matches[1][0]];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment