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 DifferentialResponsibleDatasource extends PhabricatorTypeaheadComposi..
Decoded Output download
<?php
final class DifferentialResponsibleDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Responsible Users');
}
public function getPlaceholderText() {
return pht('Type a user, project, or package name, or function...');
}
public function getDatasourceApplicationClass() {
return 'PhabricatorDifferentialApplication';
}
public function getComponentDatasources() {
return array(
new DifferentialResponsibleUserDatasource(),
new DifferentialResponsibleViewerFunctionDatasource(),
new DifferentialExactUserFunctionDatasource(),
new PhabricatorProjectDatasource(),
new PhabricatorOwnersPackageDatasource(),
);
}
public static function expandResponsibleUsers(
PhabricatorUser $viewer,
array $values) {
$phids = array();
foreach ($values as $value) {
if (phid_get_type($value) == PhabricatorPeopleUserPHIDType::TYPECONST) {
$phids[] = $value;
}
}
if (!$phids) {
return $values;
}
$projects = id(new PhabricatorProjectQuery())
->setViewer($viewer)
->withMemberPHIDs($phids)
->execute();
foreach ($projects as $project) {
$phids[] = $project->getPHID();
$values[] = $project->getPHID();
}
$packages = id(new PhabricatorOwnersPackageQuery())
->setViewer($viewer)
->withOwnerPHIDs($phids)
->execute();
foreach ($packages as $package) {
$values[] = $package->getPHID();
}
return $values;
}
}
?>
Did this file decode correctly?
Original Code
<?php
final class DifferentialResponsibleDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Responsible Users');
}
public function getPlaceholderText() {
return pht('Type a user, project, or package name, or function...');
}
public function getDatasourceApplicationClass() {
return 'PhabricatorDifferentialApplication';
}
public function getComponentDatasources() {
return array(
new DifferentialResponsibleUserDatasource(),
new DifferentialResponsibleViewerFunctionDatasource(),
new DifferentialExactUserFunctionDatasource(),
new PhabricatorProjectDatasource(),
new PhabricatorOwnersPackageDatasource(),
);
}
public static function expandResponsibleUsers(
PhabricatorUser $viewer,
array $values) {
$phids = array();
foreach ($values as $value) {
if (phid_get_type($value) == PhabricatorPeopleUserPHIDType::TYPECONST) {
$phids[] = $value;
}
}
if (!$phids) {
return $values;
}
$projects = id(new PhabricatorProjectQuery())
->setViewer($viewer)
->withMemberPHIDs($phids)
->execute();
foreach ($projects as $project) {
$phids[] = $project->getPHID();
$values[] = $project->getPHID();
}
$packages = id(new PhabricatorOwnersPackageQuery())
->setViewer($viewer)
->withOwnerPHIDs($phids)
->execute();
foreach ($packages as $package) {
$values[] = $package->getPHID();
}
return $values;
}
}
Function Calls
None |
Stats
MD5 | d8d92492fda5d421161d51769c90d179 |
Eval Count | 0 |
Decode Time | 90 ms |