@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update "bin/policy show" to use PolicyCodex

Summary: Fixes T12541. `describeAutomaticCapability()` is no longer required to implement `PolicyInterface`. Use PolicyCodex instead.

Test Plan: {F4889642}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12541

Differential Revision: https://secure.phabricator.com/D17658

+11 -7
+11 -7
src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
··· 65 65 $console->writeOut(" %s\n", 66 66 PhabricatorPolicy::getPolicyExplanation($viewer, $policy->getPHID())); 67 67 $console->writeOut("\n"); 68 + } 68 69 69 - $more = (array)$object->describeAutomaticCapability($capability); 70 - if ($more) { 71 - foreach ($more as $line) { 72 - $console->writeOut(" %s\n", $line); 73 - } 74 - $console->writeOut("\n"); 70 + if ($object instanceof PhabricatorPolicyCodexInterface) { 71 + $codex = PhabricatorPolicyCodex::newFromObject($object, $viewer); 72 + 73 + $rules = $codex->getPolicySpecialRuleDescriptions(); 74 + foreach ($rules as $rule) { 75 + echo tsprintf( 76 + " - %s\n", 77 + $rule->getDescription()); 75 78 } 76 - } 77 79 80 + echo "\n"; 81 + } 78 82 } 79 83 80 84 }