diff --git a/spec/XmlTv/XmlTvSpec.php b/spec/XmlTv/XmlTvSpec.php index 1c155fc..e16050d 100644 --- a/spec/XmlTv/XmlTvSpec.php +++ b/spec/XmlTv/XmlTvSpec.php @@ -111,13 +111,6 @@ function it_throws_if_an_element_cannot_be_serialized() { $this->shouldThrow(\TypeError::class)->duringGenerate(new UnserializableChild(), false); } - - function it_provides_support_for_legacy_code() - { - $xml = '' . PHP_EOL . '' . PHP_EOL; - - $this->generate(new LegacyMethods(), false)->shouldReturn($xml); - } } class InvalidTv extends Tv @@ -137,12 +130,3 @@ public function xmlSerialize(): XmlElement ->withChild(new \stdClass()); } } - -class LegacyMethods extends Tv -{ - public function xmlSerialize(): XmlElement - { - return (new XmlElement('tv')) - ->withOptionalChild(new XmlElement('foo')); - } -} diff --git a/src/XmlElement.php b/src/XmlElement.php index 7fcf3f8..4b1d947 100644 --- a/src/XmlElement.php +++ b/src/XmlElement.php @@ -100,18 +100,6 @@ public function withChild(?XmlSerializable $child): XmlElement return $this; } - /** - * Add an optional child. - * - * @param ?XmlSerializable $child - * @return XmlElement - * @deprecated Use `XmlElement::withChild()` instead. - */ - public function withOptionalChild(?XmlSerializable $child): XmlElement - { - return $this->withChild($child); - } - /** * Add children. *