1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-03-28 04:00:16 +01:00
phorge-arcanist/src/ref/ArcanistBuildPlanRef.php
epriestley f6b8480adc Implement "Warn When Landing" behavior for Build Plans in Arcanist
Summary:
Ref T13258. This makes "arc land" respect the new "Warn When Landing" behavior.

This will only work if you have very up-to-date APIs. Just fall back to the older code if the new API calls fail.

Test Plan: Ran `arc land` on a revision with builds in various states and with the different "Warn When Landing" behaviors. Saw appropriate warnings.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13258

Differential Revision: https://secure.phabricator.com/D20236
2019-03-06 06:47:53 -08:00

25 lines
479 B
PHP

<?php
final class ArcanistBuildPlanRef
extends Phobject {
private $parameters;
public static function newFromConduit(array $data) {
$ref = new self();
$ref->parameters = $data;
return $ref;
}
public function getPHID() {
return $this->parameters['phid'];
}
public function getBehavior($behavior_key, $default = null) {
return idxv(
$this->parameters,
array('fields', 'behaviors', $behavior_key, 'value'),
$default);
}
}