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 abstract class DiffusionCommitTransactionType extends PhabricatorModularTransacti..

Decoded Output download

<?php

abstract class DiffusionCommitTransactionType
  extends PhabricatorModularTransactionType {

  protected function updateAudits(
    PhabricatorRepositoryCommit $commit,
    array $new) {

    $audits = $commit->getAudits();
    $audits = mpull($audits, null, 'getAuditorPHID');

    foreach ($new as $phid => $status) {
      $audit = idx($audits, $phid);
      if (!$audit) {
        $audit = id(new PhabricatorRepositoryAuditRequest())
          ->setAuditorPHID($phid)
          ->setCommitPHID($commit->getPHID());

        $audits[$phid] = $audit;
      } else {
        if ($audit->getAuditStatus() === $status) {
          continue;
        }
      }

      $audit
        ->setAuditStatus($status)
        ->save();
    }

    $commit->attachAudits($audits);

    return $audits;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

abstract class DiffusionCommitTransactionType
  extends PhabricatorModularTransactionType {

  protected function updateAudits(
    PhabricatorRepositoryCommit $commit,
    array $new) {

    $audits = $commit->getAudits();
    $audits = mpull($audits, null, 'getAuditorPHID');

    foreach ($new as $phid => $status) {
      $audit = idx($audits, $phid);
      if (!$audit) {
        $audit = id(new PhabricatorRepositoryAuditRequest())
          ->setAuditorPHID($phid)
          ->setCommitPHID($commit->getPHID());

        $audits[$phid] = $audit;
      } else {
        if ($audit->getAuditStatus() === $status) {
          continue;
        }
      }

      $audit
        ->setAuditStatus($status)
        ->save();
    }

    $commit->attachAudits($audits);

    return $audits;
  }

}

Function Calls

None

Variables

None

Stats

MD5 8c8c497e747893a4c36c1046085aaa5d
Eval Count 0
Decode Time 86 ms