summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2019-06-17 23:20:43 +0100
committerAndres Rey <[email protected]>2019-06-17 23:20:43 +0100
commitf0b1288ca6d40c461df6b30296d77b9ac5425371 (patch)
tree349d08578de0a27a10969947137d1f8741d791c7
parent45a5ab6f11ce59a2ab9b18eb8c734ad18de86605 (diff)
Style CI Changes
-rw-r--r--src/Nodes/DOM/DOMNodeList.php13
-rw-r--r--src/Nodes/NodeTrait.php4
-rw-r--r--src/Nodes/NodeUtility.php4
-rw-r--r--src/Readability.php2
-rw-r--r--test/ReadabilityTest.php20
-rw-r--r--test/TestPage.php2
6 files changed, 22 insertions, 23 deletions
diff --git a/src/Nodes/DOM/DOMNodeList.php b/src/Nodes/DOM/DOMNodeList.php
index 6a53fdf..5149c0b 100644
--- a/src/Nodes/DOM/DOMNodeList.php
+++ b/src/Nodes/DOM/DOMNodeList.php
@@ -3,7 +3,7 @@
namespace andreskrey\Readability\Nodes\DOM;
/**
- * Class DOMNodeList
+ * Class DOMNodeList.
*
* This is a fake DOMNodeList class that allows adding items to the list. The original class is static and the nodes
* are defined automagically when instantiating it. This fake version behaves exactly the same way but adds the function
@@ -11,8 +11,6 @@ namespace andreskrey\Readability\Nodes\DOM;
*
* It cannot extend the original DOMNodeList class because the functionality behind the property ->length is hidden
* from the user and cannot be extended, changed, or tweaked.
- *
- * @package andreskrey\Readability\Nodes\DOM
*/
class DOMNodeList implements \Countable, \IteratorAggregate
{
@@ -27,9 +25,9 @@ class DOMNodeList implements \Countable, \IteratorAggregate
protected $length = 0;
/**
- * To allow access to length in the same way that DOMNodeList allows
+ * To allow access to length in the same way that DOMNodeList allows.
*
- * {@inheritDoc}
+ * {@inheritdoc}
*/
public function __get($name)
{
@@ -73,13 +71,12 @@ class DOMNodeList implements \Countable, \IteratorAggregate
}
/**
- * To make it compatible with iterator_to_array() function
+ * To make it compatible with iterator_to_array() function.
*
- * {@inheritDoc}
+ * {@inheritdoc}
*/
public function getIterator(): \ArrayIterator
{
return new \ArrayIterator($this->items);
}
-
}
diff --git a/src/Nodes/NodeTrait.php b/src/Nodes/NodeTrait.php
index 26f9c16..5198bbb 100644
--- a/src/Nodes/NodeTrait.php
+++ b/src/Nodes/NodeTrait.php
@@ -81,7 +81,7 @@ trait NodeTrait
*/
public function isReadabilityDataTable()
{
- /**
+ /*
* This is a workaround that I'd like to remove in the future.
* Seems that although we are extending the base DOMElement and adding custom properties (like this one,
* 'readabilityDataTable'), these properties get lost when you search for elements with getElementsByTagName.
@@ -184,8 +184,8 @@ trait NodeTrait
* @param $attributeName
*
* @return bool
- * @see getAttribute
*
+ * @see getAttribute
*/
public function hasAttribute($attributeName)
{
diff --git a/src/Nodes/NodeUtility.php b/src/Nodes/NodeUtility.php
index de6a416..cbf78ba 100644
--- a/src/Nodes/NodeUtility.php
+++ b/src/Nodes/NodeUtility.php
@@ -160,9 +160,10 @@ class NodeUtility
}
/**
- * Remove all empty DOMNodes from DOMNodeLists
+ * Remove all empty DOMNodes from DOMNodeLists.
*
* @param \DOMNodeList $list
+ *
* @return DOMNodeList
*/
public static function filterTextNodes(\DOMNodeList $list)
@@ -173,6 +174,7 @@ class NodeUtility
$newList->add($node);
}
}
+
return $newList;
}
}
diff --git a/src/Readability.php b/src/Readability.php
index 220395e..921101f 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -1121,7 +1121,7 @@ class Readability
$this->logger->info('[Rating] Adding top candidate siblings...');
- /** @var DOMElement $sibling */
+ /* @var DOMElement $sibling */
// Can't foreach here because down there we might change the tag name and that causes the foreach to skip items
for ($i = 0; $i < $siblings->length; $i++) {
$sibling = $siblings[$i];
diff --git a/test/ReadabilityTest.php b/test/ReadabilityTest.php
index df2a272..ca208e8 100644
--- a/test/ReadabilityTest.php
+++ b/test/ReadabilityTest.php
@@ -7,15 +7,15 @@ use andreskrey\Readability\ParseException;
use andreskrey\Readability\Readability;
/**
- * Class ReadabilityTest
- * @package andreskrey\Readability\Test
+ * Class ReadabilityTest.
*/
class ReadabilityTest extends \PHPUnit\Framework\TestCase
{
/**
- * Test that Readability parses the HTML correctly and matches the expected result
+ * Test that Readability parses the HTML correctly and matches the expected result.
*
* @dataProvider getSamplePages
+ *
* @param TestPage $testPage
*
* @throws ParseException
@@ -36,11 +36,11 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase
$this->assertSame($testPage->getExpectedHTML(), $readability->getContent(), 'Parsed text does not match the expected one.');
}
-
/**
- * Test that Readability parses the HTML correctly and matches the expected result
+ * Test that Readability parses the HTML correctly and matches the expected result.
*
* @dataProvider getSamplePages
+ *
* @param TestPage $testPage
*
* @throws ParseException
@@ -66,7 +66,7 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase
}
/**
- * Test that Readability returns all the expected images from the test page
+ * Test that Readability returns all the expected images from the test page.
*
* @param TestPage $testPage
* @dataProvider getSamplePages
@@ -89,7 +89,7 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase
}
/**
- * Main data provider
+ * Main data provider.
*
* @return \Generator
*/
@@ -112,7 +112,7 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase
}
/**
- * Test that Readability throws an exception with malformed HTML
+ * Test that Readability throws an exception with malformed HTML.
*
* @throws ParseException
*/
@@ -125,7 +125,7 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase
}
/**
- * Test that Readability throws an exception with incomplete or short HTML
+ * Test that Readability throws an exception with incomplete or short HTML.
*
* @throws ParseException
*/
@@ -138,7 +138,7 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase
}
/**
- * Test that the Readability object has no content as soon as it is instantiated
+ * Test that the Readability object has no content as soon as it is instantiated.
*/
public function testReadabilityCallGetContentWithNoContent()
{
diff --git a/test/TestPage.php b/test/TestPage.php
index 7859481..ed6f92e 100644
--- a/test/TestPage.php
+++ b/test/TestPage.php
@@ -10,7 +10,7 @@ class TestPage
private $expectedImages;
private $expectedMetadata;
- public function __construct( $configuration, $sourceHTML, $expectedHTML, $expectedImages, $expectedMetadata)
+ public function __construct($configuration, $sourceHTML, $expectedHTML, $expectedImages, $expectedMetadata)
{
$this->configuration = $configuration;
$this->sourceHTML = $sourceHTML;