跳到导航

2.30.0

(feat): XML (TwiML) types can now carry XML comments. comment($text) adds <!--text--> inside the element at its position in the ordered content (interleaved with addText segments and child elements), while commentBefore($text) / commentAfter($text) render a comment immediately before or after the element itself (as a sibling in its parent, or around the root element after the XML declaration). Comments in parsed documents are preserved by fromXml and round-trip through toXml; XmlElement::addComment and the new XmlComment class expose the same for untyped elements.

2.29.0

(feat): Generate a unit test file per XML-encoded (TwiML) type alongside the models, covering fromXml/toXml round trips, escaping, unknown attributes/children, open enum passthrough, child ordering, and rejection of malformed XML, wrong root elements and DOCTYPE declarations.

2.28.3

(fix): XML (TwiML) constructors and fluent child methods accept enum cases for enum-typed attributes and text, e.g. new Break_(['strength' => BreakStrength::Weak]) or ['record' => [DialRecordItem::RecordFromAnswer]], in addition to the raw string values. Previously passing the enum instance threw TypeError: Cannot assign BreakStrength to property Break_::$strength of type ?string.

(fix): List-valued XML (TwiML) attributes accept a single space-separated string in addition to an array, matching the legacy call style: new Gather(['input' => 'speech dtmf']) and $response->gather(['input' => 'speech dtmf']) no longer throw a TypeError.