amount = $amount; $this->source = $source; $this->confidence = $confidence; $this->presence = $presence; $this->reason_code = $reason_code; } /** * Missing cost — never coerce to zero. * * @param string $reason Reason code. * @return CostResolution */ public static function missing( $reason = 'MB_COST_MISSING' ) { return new self( null, 'none', 'missing', 'missing', $reason ); } /** * Ambiguous zero from source without presence semantics. * * @return CostResolution */ public static function ambiguous_zero() { return new self( null, 'unresolved', 'missing', 'ambiguous', 'MB_COST_PRESENCE_UNRESOLVED' ); } /** * @return MoneyAmount|null */ public function amount() { return $this->amount; } /** * @return string */ public function source() { return $this->source; } /** * @return string */ public function confidence() { return $this->confidence; } /** * @return string */ public function presence() { return $this->presence; } /** * @return string|null */ public function reason_code() { return $this->reason_code; } /** * @return bool */ public function is_resolved() { return null !== $this->amount; } }