fixed poll parsing
This commit is contained in:
parent
5d009163f0
commit
56078fabad
@ -524,24 +524,18 @@ class APnutI
|
||||
$this->logger->debug('Parsing ' . count($response) . ' results');
|
||||
foreach ($response as $post) {
|
||||
if (!empty($post['raw'])) {
|
||||
foreach ($post['raw'] as $raw) {
|
||||
if (!empty($raw[Poll::$notice_type])) {
|
||||
foreach ($post['raw'] as $raw_type => $raw) {
|
||||
if ($raw_type === Poll::$notice_type) {
|
||||
try {
|
||||
$this->logger->debug('Parsing poll from raw');
|
||||
$polls[] = new Poll($raw, $this);
|
||||
$this->logger->debug('Parsing poll from raw', $raw);
|
||||
/*$data = ['raw' => [
|
||||
Poll::$notice_type => $raw
|
||||
]];*/
|
||||
$polls[] = new Poll($post, $this);
|
||||
} catch (NotSupportedPollException) {
|
||||
$this->logger->warning('Parsing poll from raw failed. Loading from poll id');
|
||||
$polls[] = $this->getPoll($raw[Poll::$notice_type]['poll_id']);
|
||||
}
|
||||
// if (empty($raw[Poll::$notice_type]['prompt'])) {
|
||||
// $polls[] = $this->getPoll($raw[Poll::$notice_type]['poll_id']);
|
||||
// } else {
|
||||
// /*$poll_parsing_data = [
|
||||
// 'type' => Poll::$notice_type,
|
||||
// 'value' => $raw[Poll::$notice_type]
|
||||
// ];*/
|
||||
// $polls[] = new Poll($raw, $this);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user