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 PhutilCalendarRelativeDateTime extends PhutilCalendarProxyDateTime { ..

Decoded Output download

<?php

final class PhutilCalendarRelativeDateTime
  extends PhutilCalendarProxyDateTime {

  private $duration;

  public function setOrigin(PhutilCalendarDateTime $origin) {
    return $this->setProxy($origin);
  }

  public function getOrigin() {
    return $this->getProxy();
  }

  public function setDuration(PhutilCalendarDuration $duration) {
    $this->duration = $duration;
    return $this;
  }

  public function getDuration() {
    return $this->duration;
  }

  public function newPHPDateTime() {
    $datetime = parent::newPHPDateTime();
    $duration = $this->getDuration();

    if ($duration->getIsNegative()) {
      $sign = '-';
    } else {
      $sign = '+';
    }

    $map = array(
      'weeks' => $duration->getWeeks(),
      'days' => $duration->getDays(),
      'hours' => $duration->getHours(),
      'minutes' => $duration->getMinutes(),
      'seconds' => $duration->getSeconds(),
    );

    foreach ($map as $unit => $value) {
      if (!$value) {
        continue;
      }
      $datetime->modify("{$sign}{$value} {$unit}");
    }

    return $datetime;
  }

  public function newAbsoluteDateTime() {
    $clone = clone $this;

    if ($clone->getTimezone()) {
      $clone->setViewerTimezone(null);
    }

    $datetime = $clone->newPHPDateTime();

    return id(new PhutilCalendarAbsoluteDateTime())
      ->setYear((int)$datetime->format('Y'))
      ->setMonth((int)$datetime->format('m'))
      ->setDay((int)$datetime->format('d'))
      ->setHour((int)$datetime->format('H'))
      ->setMinute((int)$datetime->format('i'))
      ->setSecond((int)$datetime->format('s'))
      ->setIsAllDay($clone->getIsAllDay())
      ->setTimezone($clone->getTimezone())
      ->setViewerTimezone($this->getViewerTimezone());
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhutilCalendarRelativeDateTime
  extends PhutilCalendarProxyDateTime {

  private $duration;

  public function setOrigin(PhutilCalendarDateTime $origin) {
    return $this->setProxy($origin);
  }

  public function getOrigin() {
    return $this->getProxy();
  }

  public function setDuration(PhutilCalendarDuration $duration) {
    $this->duration = $duration;
    return $this;
  }

  public function getDuration() {
    return $this->duration;
  }

  public function newPHPDateTime() {
    $datetime = parent::newPHPDateTime();
    $duration = $this->getDuration();

    if ($duration->getIsNegative()) {
      $sign = '-';
    } else {
      $sign = '+';
    }

    $map = array(
      'weeks' => $duration->getWeeks(),
      'days' => $duration->getDays(),
      'hours' => $duration->getHours(),
      'minutes' => $duration->getMinutes(),
      'seconds' => $duration->getSeconds(),
    );

    foreach ($map as $unit => $value) {
      if (!$value) {
        continue;
      }
      $datetime->modify("{$sign}{$value} {$unit}");
    }

    return $datetime;
  }

  public function newAbsoluteDateTime() {
    $clone = clone $this;

    if ($clone->getTimezone()) {
      $clone->setViewerTimezone(null);
    }

    $datetime = $clone->newPHPDateTime();

    return id(new PhutilCalendarAbsoluteDateTime())
      ->setYear((int)$datetime->format('Y'))
      ->setMonth((int)$datetime->format('m'))
      ->setDay((int)$datetime->format('d'))
      ->setHour((int)$datetime->format('H'))
      ->setMinute((int)$datetime->format('i'))
      ->setSecond((int)$datetime->format('s'))
      ->setIsAllDay($clone->getIsAllDay())
      ->setTimezone($clone->getTimezone())
      ->setViewerTimezone($this->getViewerTimezone());
  }

}

Function Calls

None

Variables

None

Stats

MD5 09389e4146973f0b3bd913f59d49aa2d
Eval Count 0
Decode Time 89 ms