Skip to content

Commit

Permalink
Remove useless phpdoc @throws
Browse files Browse the repository at this point in the history
  • Loading branch information
ddebin committed Mar 19, 2024
1 parent 087666f commit 18cc85c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
11 changes: 2 additions & 9 deletions src/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace AtomGenerator;

use DOMDocument;
use Exception;
use LibXMLError;
use SimpleXMLElement;
use Webmozart\Assert\Assert;
Expand Down Expand Up @@ -153,6 +152,7 @@ public function addChildrenTo(SimpleXMLElement $parent): void

if (null !== $this->generator) {
$generator = $parent->addChild('generator', htmlspecialchars($this->generator));
assert(null !== $generator);
if (null !== $this->generatorVersion) {
$generator->addAttribute('version', $this->generatorVersion);
}
Expand All @@ -163,6 +163,7 @@ public function addChildrenTo(SimpleXMLElement $parent): void

foreach ($this->customElements as $customElement) {
$element = $parent->addChild($customElement['name'], htmlspecialchars($customElement['value']), $customElement['uri']);
assert(null !== $element);
foreach ($customElement['attributes'] as $name => $value) {
$element->addAttribute($name, $value);
}
Expand All @@ -173,9 +174,6 @@ public function addChildrenTo(SimpleXMLElement $parent): void
}
}

/**
* @throws Exception
*/
public function getSimpleXML(): SimpleXMLElement
{
$attributes = [];
Expand All @@ -198,9 +196,6 @@ public function getSimpleXML(): SimpleXMLElement
return $xml;
}

/**
* @throws Exception
*/
public function getDocument(): DOMDocument
{
$node = dom_import_simplexml($this->getSimpleXML());
Expand All @@ -212,8 +207,6 @@ public function getDocument(): DOMDocument

/**
* @return false|string
*
* @throws Exception
*/
public function saveXML()
{
Expand Down
15 changes: 0 additions & 15 deletions tests/FeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use AtomGenerator\Entry;
use AtomGenerator\Feed;
use DateTime;
use Exception;
use InvalidArgumentException;
use LibXMLError;
use PHPUnit\Framework\TestCase;
Expand All @@ -25,9 +24,6 @@ final class FeedTest extends TestCase
/** @var bool reset file contents */
protected static $reset = false;

/**
* @throws Exception
*/
public function testFeedCreation1(): void
{
$feed = new Feed();
Expand Down Expand Up @@ -78,9 +74,6 @@ public function testFeedCreation1(): void
self::assertXmlStringEqualsXmlFile(self::TEST_FEED_XML_PATH_1, $xml);
}

/**
* @throws Exception
*/
public function testFeedCreation2(): void
{
$feed = new Feed();
Expand Down Expand Up @@ -113,9 +106,6 @@ public function testFeedCreation2(): void
self::assertXmlStringEqualsXmlFile(self::TEST_FEED_XML_PATH_2, $xml);
}

/**
* @throws Exception
*/
public function testFeedCreation3(): void
{
$feed = new Feed();
Expand Down Expand Up @@ -144,9 +134,6 @@ public function testFeedCreation3(): void
self::assertXmlStringEqualsXmlFile(self::TEST_FEED_XML_PATH_3, $xml);
}

/**
* @throws Exception
*/
public function testFeedCreation4(): void
{
$sourceFeed = new Feed();
Expand Down Expand Up @@ -213,8 +200,6 @@ public function testFeedCreationException3(): void

/**
* @codeCoverageIgnore
*
* @throws Exception
*/
public function testFeedCreationException4(): void
{
Expand Down

0 comments on commit 18cc85c

Please sign in to comment.