Пример #1
0
 /**
  * @param array|null $data
  *
  * @return ParserReplyInterface
  */
 private function createReplyForEmptyData($data)
 {
     assert('empty($data) && (is_array($data) || is_null($data))');
     $replyType = $data === null ? ParserReplyInterface::REPLY_TYPE_NULL_RESOURCE_STARTED : ParserReplyInterface::REPLY_TYPE_EMPTY_RESOURCE_STARTED;
     return $this->parserFactory->createEmptyReply($replyType, $this->stack);
 }
Пример #2
0
 /**
  * @param array|null $data
  *
  * @return ParserReplyInterface
  */
 private function createReplyForEmptyData($data)
 {
     $data === null || is_array($data) === true && empty($data) === true ?: Exceptions::throwLogicException();
     $replyType = $data === null ? ParserReplyInterface::REPLY_TYPE_NULL_RESOURCE_STARTED : ParserReplyInterface::REPLY_TYPE_EMPTY_RESOURCE_STARTED;
     return $this->parserFactory->createEmptyReply($replyType, $this->stack);
 }