private function restoreCheckContentsType(array $data) { if (!is_string($data['id']) || !is_array($data['items'])) { throw new CartRestoreException('Cart ID not a string or cart items not an array.'); } }