Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php final class ChatLogQueryConduitAPIMethod extends ChatLogConduitAPIMethod { publi..

Decoded Output download

<?php

final class ChatLogQueryConduitAPIMethod extends ChatLogConduitAPIMethod {

  public function getAPIMethodName() {
    return 'chatlog.query';
  }

  public function getMethodStatus() {
    return self::METHOD_STATUS_UNSTABLE;
  }

  public function getMethodDescription() {
    return pht('Retrieve chatter.');
  }

  protected function defineParamTypes() {
    return array(
      'channels' => 'optional list<string>',
      'limit'    => 'optional int (default = 100)',
    );
  }

  protected function defineReturnType() {
    return 'nonempty list<dict>';
  }

  protected function execute(ConduitAPIRequest $request) {
    $query = new PhabricatorChatLogQuery();

    $channel_ids = $request->getValue('channelIDs');
    if ($channel_ids) {
      $query->withChannelIDs($channel_ids);
    }

    $limit = $request->getValue('limit');
    if (!$limit) {
      $limit = 100;
    }
    $query->setLimit($limit);

    $logs = $query->execute();

    $results = array();
    foreach ($logs as $log) {
      $results[] = array(
        'channelID'       => $log->getChannelID(),
        'epoch'           => $log->getEpoch(),
        'author'          => $log->getAuthor(),
        'type'            => $log->getType(),
        'message'         => $log->getMessage(),
        'loggedByPHID'    => $log->getLoggedByPHID(),
      );
    }

    return $results;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class ChatLogQueryConduitAPIMethod extends ChatLogConduitAPIMethod {

  public function getAPIMethodName() {
    return 'chatlog.query';
  }

  public function getMethodStatus() {
    return self::METHOD_STATUS_UNSTABLE;
  }

  public function getMethodDescription() {
    return pht('Retrieve chatter.');
  }

  protected function defineParamTypes() {
    return array(
      'channels' => 'optional list<string>',
      'limit'    => 'optional int (default = 100)',
    );
  }

  protected function defineReturnType() {
    return 'nonempty list<dict>';
  }

  protected function execute(ConduitAPIRequest $request) {
    $query = new PhabricatorChatLogQuery();

    $channel_ids = $request->getValue('channelIDs');
    if ($channel_ids) {
      $query->withChannelIDs($channel_ids);
    }

    $limit = $request->getValue('limit');
    if (!$limit) {
      $limit = 100;
    }
    $query->setLimit($limit);

    $logs = $query->execute();

    $results = array();
    foreach ($logs as $log) {
      $results[] = array(
        'channelID'       => $log->getChannelID(),
        'epoch'           => $log->getEpoch(),
        'author'          => $log->getAuthor(),
        'type'            => $log->getType(),
        'message'         => $log->getMessage(),
        'loggedByPHID'    => $log->getLoggedByPHID(),
      );
    }

    return $results;
  }

}

Function Calls

None

Variables

None

Stats

MD5 c2310a4b35d8bb5c2085bdb2c04f307c
Eval Count 0
Decode Time 118 ms