Skip to content

Commit

Permalink
Merge 5c1d65d into 9306996
Browse files Browse the repository at this point in the history
  • Loading branch information
j0k3r committed Jan 6, 2020
2 parents 9306996 + 5c1d65d commit 5755deb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- nightly

matrix:
include:
- php: 7.2
env: CS_FIXER=run
env: SYMFONY_PHPUNIT_VERSION=7.5
- php: 7.3
env: SYMFONY_PHPUNIT_VERSION=7.5 CS_FIXER=run
- php: 7.4
env: SYMFONY_PHPUNIT_VERSION=7.5 CS_FIXER=run
- php: nightly
env: SYMFONY_PHPUNIT_VERSION=7.5 CS_FIXER=run
fast_finish: true
allow_failures:
- php: 7.4
- php: nightly

# cache vendor dirs
Expand All @@ -36,6 +40,9 @@ script:
- mkdir -p build/logs
- php vendor/bin/simple-phpunit -v --coverage-clover build/logs/clover.xml
- if [ "$CS_FIXER" = "run" ]; then php vendor/bin/php-cs-fixer fix --verbose --dry-run ; fi;
# only install phpstan when we need it
- if [ "$CS_FIXER" = "run" ]; then composer require phpstan/phpstan --no-progress --no-suggest ; fi;
- if [ "$CS_FIXER" = "run" ]; then composer require phpstan/phpstan-phpunit --no-progress --no-suggest ; fi;
- if [ "$CS_FIXER" = "run" ]; then php vendor/bin/phpstan analyse src tests --no-progress --level 1 ; fi;

after_script:
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ includes:
parameters:
# https://github.com/phpstan/phpstan/issues/694#issuecomment-350724288
autoload_files:
- vendor/bin/.phpunit/phpunit-7.4/vendor/autoload.php
- vendor/bin/.phpunit/phpunit-7.5-0/vendor/autoload.php
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
bootstrap="vendor/autoload.php"
>

<php>
<env name="SYMFONY_PHPUNIT_VERSION" value="7.5" />
</php>

<testsuites>
<testsuite name="Readability Test Suite">
<directory>./tests/</directory>
Expand Down
26 changes: 4 additions & 22 deletions src/Readability.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ public function init()

/**
* Run any post-process modifications to article content as necessary.
*
* @param \DOMElement $articleContent
*/
public function postProcessContent(\DOMElement $articleContent)
{
Expand All @@ -321,8 +319,6 @@ public function postProcessContent(\DOMElement $articleContent)
* For easier reading, convert this document to have footnotes at the bottom rather than inline links.
*
* @see http://www.roughtype.com/archives/2010/05/experiments_in.php
*
* @param \DOMElement $articleContent
*/
public function addFootnotes(\DOMElement $articleContent)
{
Expand Down Expand Up @@ -385,8 +381,6 @@ public function addFootnotes(\DOMElement $articleContent)
/**
* Prepare the article node for display. Clean out any inline styles,
* iframes, forms, strip extraneous <p> tags, etc.
*
* @param \DOMNode $articleContent
*/
public function prepArticle(\DOMNode $articleContent)
{
Expand Down Expand Up @@ -558,8 +552,7 @@ public function getWordCount($text)
* This is the amount of text that is inside a link divided by the total text in the node.
* Can exclude external references to differentiate between simple text and menus/infoblocks.
*
* @param \DOMElement $e
* @param bool $excludeExternal
* @param bool $excludeExternal
*
* @return int
*/
Expand All @@ -586,8 +579,6 @@ public function getLinkDensity(\DOMElement $e, $excludeExternal = false)
/**
* Get an element relative weight.
*
* @param \DOMElement $e
*
* @return int
*/
public function getWeight(\DOMElement $e)
Expand All @@ -607,8 +598,6 @@ public function getWeight(\DOMElement $e)

/**
* Remove extraneous break tags from a node.
*
* @param \DOMElement $node
*/
public function killBreaks(\DOMElement $node)
{
Expand All @@ -623,8 +612,7 @@ public function killBreaks(\DOMElement $node)
*
* Updated 2012-09-18 to preserve youtube/vimeo iframes
*
* @param \DOMElement $e
* @param string $tag
* @param string $tag
*/
public function clean(\DOMElement $e, $tag)
{
Expand Down Expand Up @@ -659,8 +647,7 @@ public function clean(\DOMElement $e, $tag)
* "Fishy" is an algorithm based on content length, classnames,
* link density, number of images & embeds, etc.
*
* @param \DOMElement $e
* @param string $tag
* @param string $tag
*/
public function cleanConditionally(\DOMElement $e, $tag)
{
Expand Down Expand Up @@ -772,8 +759,6 @@ public function cleanConditionally(\DOMElement $e, $tag)

/**
* Clean out spurious headers from an Element. Checks things like classnames and link density.
*
* @param \DOMElement $e
*/
public function cleanHeaders(\DOMElement $e)
{
Expand Down Expand Up @@ -915,8 +900,6 @@ protected function prepDocument()
/**
* Initialize a node with the readability object. Also checks the
* className/id for special names to add to its score.
*
* @param \DOMElement $node
*/
protected function initializeNode(\DOMElement $node)
{
Expand Down Expand Up @@ -1346,8 +1329,7 @@ protected function grabArticle(\DOMElement $page = null)
* Get an element weight by attribute.
* Uses regular expressions to tell if this element looks good or bad.
*
* @param \DOMElement $element
* @param string $attribute
* @param string $attribute
*
* @return int
*/
Expand Down

0 comments on commit 5755deb

Please sign in to comment.