Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/contentsource/PhabricatorContentSource.php
| Show All 26 Lines | public static function newForSource($source, array $params) { | ||||
| $obj = new PhabricatorContentSource(); | $obj = new PhabricatorContentSource(); | ||||
| $obj->source = $source; | $obj->source = $source; | ||||
| $obj->params = $params; | $obj->params = $params; | ||||
| return $obj; | return $obj; | ||||
| } | } | ||||
| public static function newFromSerialized($serialized) { | public static function newFromSerialized($serialized) { | ||||
| $dict = json_decode($serialized, true); | $dict = phutil_json_decode($serialized); | ||||
| if (!is_array($dict)) { | if (!is_array($dict)) { | ||||
| $dict = array(); | $dict = array(); | ||||
| } | } | ||||
| $obj = new PhabricatorContentSource(); | $obj = new PhabricatorContentSource(); | ||||
| $obj->source = idx($dict, 'source', self::SOURCE_UNKNOWN); | $obj->source = idx($dict, 'source', self::SOURCE_UNKNOWN); | ||||
| $obj->params = idx($dict, 'params', array()); | $obj->params = idx($dict, 'params', array()); | ||||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||