MCPcopy Create free account
hub / github.com/Rello/analytics / normalizePages

Method normalizePages

lib/Service/PanoramaService.php:295–315  ·  view source on GitHub ↗
(mixed $pages)

Source from the content-addressed store, hash-verified

293 }
294
295 private function normalizePages(mixed $pages): ?array {
296 if (is_string($pages)) {
297 $pages = json_decode($pages, true);
298 }
299 if (!is_array($pages)) {
300 return null;
301 }
302 foreach ($pages as &$page) {
303 if (!is_array($page)) {
304 return null;
305 }
306 $layoutId = filter_var($page['layoutId'] ?? 0, FILTER_VALIDATE_INT);
307 if ($layoutId === false || $layoutId < 0 || $layoutId > 6) {
308 return null;
309 }
310 $page['layoutId'] = $layoutId;
311 unset($page['layout']);
312 }
313 unset($page);
314 return $pages;
315 }
316
317 /**
318 * get own reports which are marked as favorites

Callers 1

updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected