'维护页', 'not-found' => '404 页']; public static function slugMatches(string $type, mixed $slug): bool { return isset(self::TYPES[$type]) && is_string($slug) && preg_match('/^system--' . $type . '-[a-f0-9]{16}$/D', $slug) === 1; } public static function published(Repository $repo, string $type, mixed $slug): ?array { if (!self::slugMatches($type, $slug)) { return null; } $page = $repo->page($slug); return $page && $page['page_type'] === $type && $page['status'] === 'published' ? $page : null; } }