@@ -12,26 +12,32 @@ public function __construct($json, $mandator)
12
12
$ c = $ json ->conference ;
13
13
$ this ->start = DateTime::createFromFormat (DateTimeInterface::ISO8601 , $ c ->start );
14
14
$ this ->end = DateTime::createFromFormat (DateTimeInterface::ISO8601 , $ c ->end );
15
- $ this ->html = @ $ c ->streamingConfig ->html ? : [];
15
+ $ this ->html = isset ( $ c ->streamingConfig ->html ) ? $ c -> streamingConfig -> html : [];
16
16
17
17
$ this ->rooms = [];
18
- $ rooms = (is_array (@$ c ->rooms ) ? $ c ->rooms : @$ c ->rooms ->nodes ) ?: [];
18
+ if (isset ($ c ->rooms )) {
19
+ if (is_array ($ c ->rooms )) {
20
+ $ rooms = $ c ->rooms ;
21
+ } else {
22
+ $ rooms = isset ($ c ->rooms ->nodes ) ? $ c ->rooms ->nodes : [];
23
+ }
24
+ }
19
25
foreach ($ rooms as $ r ) {
20
26
if (!$ r ) {
21
27
continue ;
22
28
}
23
29
$ this ->rooms [$ r ->slug ] = array_merge (
24
30
['stream ' => $ r ->streamId ],
25
- get_object_vars ($ r ),
26
- @ get_object_vars ( $ r ->streamingConfig ) ?: [],
27
- @ get_object_vars ( $ r ->streamingConfig ->chat ) ?: []
31
+ get_object_vars ($ r ),
32
+ ( isset ( $ r ->streamingConfig ) ? get_object_vars ( $ r -> streamingConfig ) : []),
33
+ ( isset ( $ r ->streamingConfig ->chat ) ? get_object_vars ( $ r -> streamingConfig -> chat ) : [])
28
34
);
29
35
}
30
36
31
37
$ groups = [];
32
38
if ( isset ($ c ->streamingConfig ->overviewPage ->sections ) ) {
33
- foreach (@ $ c ->streamingConfig ->overviewPage ->sections as $ s ) {
34
- $ groups [@ $ s ->title ] = array_map (
39
+ foreach ($ c ->streamingConfig ->overviewPage ->sections as $ s ) {
40
+ $ groups [$ s ->title ] = array_map (
35
41
function ($ r ) { return $ r ->slug ; },
36
42
@$ s ->items ?: @$ s ->rooms ?: []
37
43
);
@@ -44,15 +50,15 @@ function($r) { return $r->slug; },
44
50
$ acronym = $ mandator ?: $ c ->acronym ;
45
51
46
52
parent ::__construct (array_merge (
47
- @ get_object_vars ($ c ->streamingConfig ) ?: [],
48
- @ get_object_vars ($ c ->streamingConfig ->features ) ?: [],
49
- @ get_object_vars ($ c ->streamingConfig ->features ->chat ) ?: [],
53
+ isset ($ c ->streamingConfig ) ? get_object_vars ( $ c -> streamingConfig ) : [],
54
+ isset ($ c ->streamingConfig ->features ) ? get_object_vars ( $ c -> streamingConfig -> features ) : [],
55
+ isset ($ c ->streamingConfig ->features ->chat ) ? get_object_vars ( $ c -> streamingConfig -> features -> chat ) : [],
50
56
[
51
57
'conference ' => [
52
58
'title ' => $ c ->title ,
53
59
'author ' => $ c ->organizer ,
54
60
'description ' => $ c ->description ,
55
- 'keywords ' => @ implode (', ' , $ c ->keywords ),
61
+ 'keywords ' => is_array ( $ c -> keywords ) ? implode (', ' , $ c ->keywords ) : "" ,
56
62
// future TODO: change structure
57
63
"relive_json " => @$ c ->streamingConfig ->features ->relive !== false ? "https://cdn.c3voc.de/relive/ " .$ acronym ."/index.json " : null ,
58
64
"releases " => @$ c ->streamingConfig ->features ->releases !== false ? "https://media.ccc.de/c/ " .$ acronym : null
@@ -140,21 +146,21 @@ public function hasBannerHtml() {
140
146
return !empty ($ this ->html ->banner );
141
147
}
142
148
public function getBannerHtml () {
143
- return @ $ this ->html ->banner ;
149
+ return isset ( $ this ->html ->banner ) ? $ this -> html -> banner : "" ;
144
150
}
145
151
146
152
public function hasFooterHtml () {
147
153
return !empty ($ this ->html ->footer );
148
154
}
149
155
public function getFooterHtml () {
150
- return @ $ this ->html ->footer ;
156
+ return isset ( $ this ->html ->footer ) ? $ this -> html -> footer : "" ;
151
157
}
152
158
153
159
public function hasNotStartedHtml () {
154
160
return !empty ($ this ->html ->not_started );
155
161
}
156
162
public function getNotStartedHtml () {
157
- return @ $ this ->html ->not_started ;
163
+ return isset ( $ this ->html ->not_started ) ? $ this -> html -> not_started : "" ;
158
164
}
159
165
160
166
}
0 commit comments