Skip to content

Commit b7ce293

Browse files
committed
Small simplifications
1 parent f2f410e commit b7ce293

2 files changed

Lines changed: 3 additions & 15 deletions

File tree

lib/errors.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,9 @@ public function get_function_stack(?Throwable $error = null)
186186
}
187187
if (array_key_exists('class', $frame)) {
188188
$line .= $frame['class'];
189-
if (array_key_exists('type', $frame)) {
190-
$line .= $frame['type'];
191-
} else {
192-
$line .= '::';
193-
}
194-
}
195-
if (array_key_exists('function', $frame)) {
196-
$line .= $frame['function'];
197-
} else {
198-
$line .= 'require, include or eval';
189+
$line .= $frame['type'] ?? '::';
199190
}
191+
$line .= $frame['function'] ?? 'require, include or eval';
200192
$stacktrace[] = $line;
201193
}
202194

lib/midcom/helper/nav/item.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ protected function get_cache() : midcom_services_cache_module_nap
4040
public function __get($name)
4141
{
4242
$name = $this->translate_name($name);
43-
$data = $this->get_data();
44-
if (!array_key_exists($name, $data)) {
45-
return null;
46-
}
47-
return $data[$name];
43+
return $this->get_data()[$name] ?? null;
4844
}
4945

5046
/**

0 commit comments

Comments
 (0)