Skip to content

Commit

Permalink
Remove deprecated withOptionalChild method
Browse files Browse the repository at this point in the history
  • Loading branch information
jaylinski committed May 22, 2021
1 parent 8ce7e4d commit 156c077
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
16 changes: 0 additions & 16 deletions spec/XmlTv/XmlTvSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<?xml version="1.0"?>' . PHP_EOL . '<tv/>' . PHP_EOL;

$this->generate(new LegacyMethods(), false)->shouldReturn($xml);
}
}

class InvalidTv extends Tv
Expand All @@ -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'));
}
}
12 changes: 0 additions & 12 deletions src/XmlElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 156c077

Please sign in to comment.