@param int    $ticketId
@param string $text
@param bool   $interimNotice

@return int
493319
public function post($ticketId, $text, $interimNotice = false)
	{
		$data = new TicketMessageAddTransfer();
		$data->id_ticket = (int)$ticketId;
		$data->text = $text;
		$data->interim_notice = $interimNotice;

		$endpoint = new Post($this->getTransport());
		$endpoint->setTransfer($data);

		$resultRequest = $endpoint->performRequest();

		return Response::extractId($resultRequest, '/ticket-messages/%d/');
	}
64726
@SneakyThrows
    protected Ticket encodeTicket(final Ticket ticket) {
        if (!isCipherExecutorEnabled()) {
            LOGGER.trace(MESSAGE);
            return ticket;
        }
        if (ticket == null) {
            LOGGER.debug("Ticket passed is null and cannot be encoded");
            return null;
        }
        LOGGER.debug("Encoding ticket [{}]", ticket);
        val encodedTicketObject = SerializationUtils.serializeAndEncodeObject(this.cipherExecutor, ticket);
        val encodedTicketId = encodeTicketId(ticket.getId());
        val encodedTicket = new EncodedTicket(encodedTicketId, ByteSource.wrap(encodedTicketObject).read());
        LOGGER.debug("Created encoded ticket [{}]", encodedTicket);
        return encodedTicket;
    }
746427
protected TicketGrantingTicket createOrUpdateTicketGrantingTicket(final AuthenticationResult authenticationResult,
                                                                      final Authentication authentication, final String ticketGrantingTicket) {
        try {
            if (shouldIssueTicketGrantingTicket(authentication, ticketGrantingTicket)) {
                LOGGER.debug("Attempting to issue a new ticket-granting ticket...");
                return this.centralAuthenticationService.createTicketGrantingTicket(authenticationResult);
            }
            LOGGER.debug("Updating the existing ticket-granting ticket [{}]...", ticketGrantingTicket);
            val tgt = this.centralAuthenticationService.getTicket(ticketGrantingTicket, TicketGrantingTicket.class);
            tgt.getAuthentication().update(authentication);
            this.centralAuthenticationService.updateTicket(tgt);
            return tgt;
        } catch (final PrincipalException e) {
            LOGGER.error(e.getMessage(), e);
            throw e;
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
            throw new InvalidTicketException(ticketGrantingTicket);
        }
    }
339904
public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $text)
    {
        //lastWrittenPercent and lastWrittenTime are used to prevent performance issues if
        //many progresses are written. (the filesystem access at nfs can slow that down)
        //we just update the progressbar if the percentage increases and
        //the last request was at least 500ms ago
        if (!$this->_lastWrittenPercent) {
            $this->_lastWrittenPercent = (int)($percent*100);
        }
        if (!$this->_lastWrittenTime) {
            $this->_lastWrittenTime = microtime(true);
        }
        if ($this->_lastWrittenPercent < (int)($percent*100)
            && $this->_lastWrittenTime+0.5 <= microtime(true)) {
            $arguments = array(
                'current'       => $current,
                'max'           => $max,
                'percent'       => ($percent * 100),
                'timeTaken'     => $timeTaken,
                'timeRemaining' => $timeRemaining,
                'text'          => $text,
                'finished'      => false
            );
            $this->_saveStatus($arguments);
            $this->_lastWrittenPercent = (int)($percent*100);
            $this->_lastWrittenTime = microtime(true);
        }
    }
822731
public function basic_publish(
        $msg,
        $exchange = '',
        $routing_key = '',
        $mandatory = false,
        $immediate = false,
        $ticket = null
    ) {
        $pkt = new AMQPWriter();
        $pkt->write($this->pre_publish($exchange, $routing_key, $mandatory, $immediate, $ticket));

        try {
            $this->connection->send_content(
                $this->channel_id,
                60,
                0,
                mb_strlen($msg->body, 'ASCII'),
                $msg->serialize_properties(),
                $msg->body,
                $pkt
            );
        } catch (AMQPConnectionClosedException $e) {
            $this->do_close();
            throw $e;
        }

        if ($this->next_delivery_tag > 0) {
            $this->published_messages[$this->next_delivery_tag] = $msg;
            $this->next_delivery_tag = bcadd($this->next_delivery_tag, '1', 0);
        }
    }
570826
public static function sendGreenAlert(string $text, int $to_user_id = USER_ID, int $from_user_id = 0): UsersMessageEntity
    {
        return self::sendMessage($text, $to_user_id, $from_user_id, self::TOASTR_MESSAGE_COLOR_GREEN);
    }
1373019
public function iWaitForTextToDisappear($text)
   {
       $this->spin(function(FeatureContext $context) use ($text) {
           try {
               $context->assertPageContainsText($text);
           }
           catch(\Behat\Mink\Exception\ResponseTextException $e) {
               return true;
           }
           return false;
       });
   }
1154391
public function createMessage(TicketInterface $ticket = null)
    {
        /* @var TicketMessageInterface $message */
        $message = new $this->ticketMessageClass();

        if ($ticket) {
            $message->setPriority($ticket->getPriority());
            $message->setStatus($ticket->getStatus());
            $message->setTicket($ticket);
        } else {
            $message->setStatus(TicketMessage::STATUS_OPEN);
        }

        return $message;
    }
1224460
@GetMapping(value = "/v1/tickets/{id:.+}")
    public ResponseEntity<String> getTicketStatus(@PathVariable("id") final String id) {
        try {
            val ticket = this.centralAuthenticationService.getTicket(id);
            return new ResponseEntity<>(ticket.getId(), HttpStatus.OK);
        } catch (final InvalidTicketException e) {
            return new ResponseEntity<>("Ticket could not be found", HttpStatus.NOT_FOUND);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
            return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }
900365
@SuppressLint("NewApi")
    public static void tryAccessibilityAnnounce(View view, CharSequence text) {
        if (isJellybeanOrLater() && view != null && text != null) {
            view.announceForAccessibility(text);
        }
    }
765803
public function addNext($text, $template = null)
    {
        if(!empty($text))
        {
            $this->callToActions = ['message' => ['text' => $text]];
        }
        
        if(!empty($template))
        {
            if($template instanceof StructuredMessage)
            {
                $this->callToActions = ['message' => [$template->getDataForCall(FALSE)]];
            }
            else
            {
                throw new MessengerPlatformException('Template for welcome message is not StructuredMessage.', 4);
            }
        }
    }
631788
public function hereNow($venueId)
    {

        $resource = '/venues/' . $venueId . '/herenow';
        $response = $this->makeApiRequest($resource);

        if(property_exists($response, 'hereNow')) {
            return $response->hereNow->count;
        }

        return 0;

    }
835052
public long ticketKeyRenew() {
        Lock readerLock = context.ctxLock.readLock();
        readerLock.lock();
        try {
            return SSLContext.sessionTicketKeyRenew(context.ctx);
        } finally {
            readerLock.unlock();
        }
    }
287838
public function checkCurrentToken($id, $text = false) {
		$token = $this->getCurrentToken();
		return $this->checkToken($token, $id, $text);
	}
633808
public function addNotice($message, ...$text): void
    {
        $this->add(self::TYPE_NOTICE, $message, ...$text);
    }
80653
@SneakyThrows
    protected Ticket decodeTicket(final Ticket result) {
        if (!isCipherExecutorEnabled()) {
            LOGGER.trace(MESSAGE);
            return result;
        }
        if (result == null) {
            LOGGER.warn("Ticket passed is null and cannot be decoded");
            return null;
        }
        if (!result.getClass().isAssignableFrom(EncodedTicket.class)) {
            LOGGER.warn("Ticket passed is not an encoded ticket type; rather it's a [{}], no decoding is necessary.", result.getClass().getSimpleName());
            return result;
        }
        LOGGER.debug("Attempting to decode [{}]", result);
        val encodedTicket = (EncodedTicket) result;
        val ticket = SerializationUtils.decodeAndDeserializeObject(encodedTicket.getEncodedTicket(), this.cipherExecutor, Ticket.class);
        LOGGER.debug("Decoded ticket to [{}]", ticket);
        return ticket;
    }
270544
private static Collection<MessageDescriptor> calculateAuthenticationWarningMessages(final TicketGrantingTicket tgtId, final MessageContext messageContext) {
        val entries = tgtId.getAuthentication().getSuccesses().entrySet();
        val messages = entries
            .stream()
            .map(entry -> entry.getValue().getWarnings())
            .filter(entry -> !entry.isEmpty())
            .collect(Collectors.toList());
        messages.add(tgtId.getAuthentication().getWarnings());

        return messages
            .stream()
            .flatMap(Collection::stream)
            .peek(message -> addMessageDescriptorToMessageContext(messageContext, message))
            .collect(Collectors.toSet());
    }