Skip to content

Commit b69619d

Browse files
committed
Merge pull request #3 from j0k3r/phpunit-travis
Improve Travis
2 parents ddd013e + 1963319 commit b69619d

File tree

8 files changed

+161
-129
lines changed

8 files changed

+161
-129
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
vendor/
2+
coverage/
3+
composer.lock

.scrutinizer.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tools:
2+
external_code_coverage:
3+
timeout: 600

.travis.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,29 @@ php:
44
- 5.4
55
- 5.5
66
- 5.6
7+
- nightly
8+
- hhvm-nightly
79

8-
before_script:
10+
# run build against nightly but allow them to fail
11+
matrix:
12+
fast_finish: true
13+
allow_failures:
14+
- php: nightly
15+
- php: hhvm-nightly
16+
17+
# faster builds on new travis setup not using sudo
18+
sudo: false
19+
20+
install:
921
- composer self-update
22+
23+
before_script:
1024
- composer install --prefer-dist --no-interaction
1125

1226
script:
13-
- phpunit --coverage-text
27+
- phpunit --coverage-clover=coverage.clover
28+
29+
after_script:
30+
- |
31+
wget https://scrutinizer-ci.com/ocular.phar
32+
php ocular.phar code-coverage:upload --format=php-clover coverage.clover

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Readability
22

33
[![Build Status](https://travis-ci.org/j0k3r/php-readability.svg?branch=master)](https://travis-ci.org/j0k3r/php-readability)
4+
[![Code Coverage](https://scrutinizer-ci.com/g/j0k3r/php-readability/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/j0k3r/php-readability/?branch=master)
45

56
This is an extract of the Readability class from the [full-text-rss](https://github.com/Dither/full-text-rss) fork. It kind be defined as a better version of the original [php-readability](http://code.fivefilters.org/php-readability).
67

phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919

2020
<filter>
2121
<whitelist>
22-
<directory>./src/TubeLink/</directory>
22+
<directory>./src/</directory>
2323
<exclude>
2424
<directory>./tests</directory>
2525
</exclude>
2626
</whitelist>
2727
</filter>
2828

29+
<logging>
30+
<log type="coverage-html" target="coverage" title="FullText" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/>
31+
</logging>
2932
</phpunit>

src/JSLikeHTMLElement.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Readability;
44

55
/**
6-
* JavaScript-like HTML DOM Element
6+
* JavaScript-like HTML DOM Element.
77
*
88
* This class extends PHP's DOMElement to allow
99
* users to get and set the innerHTML property of
@@ -31,12 +31,14 @@
3131
* echo $doc->saveXML();
3232
*
3333
* @author Keyvan Minoukadeh - http://www.keyvan.net - [email protected]
34+
*
3435
* @see http://fivefilters.org (the project this was written for)
3536
*/
3637
class JSLikeHTMLElement extends \DOMElement
3738
{
3839
/**
39-
* Used for setting innerHTML like it's done in JavaScript:
40+
* Used for setting innerHTML like it's done in JavaScript:.
41+
*
4042
* @code
4143
* $div->innerHTML = '<h2>Chapter 2</h2><p>The story begins...</p>';
4244
* @endcode
@@ -45,7 +47,7 @@ public function __set($name, $value)
4547
{
4648
if ($name == 'innerHTML') {
4749
// first, empty the element
48-
for ($x=$this->childNodes->length-1; $x>=0; $x--) {
50+
for ($x = $this->childNodes->length - 1; $x >= 0; $x--) {
4951
$this->removeChild($this->childNodes->item($x));
5052
}
5153
// $value holds our new inner HTML
@@ -86,7 +88,8 @@ public function __set($name, $value)
8688
}
8789

8890
/**
89-
* Used for getting innerHTML like it's done in JavaScript:
91+
* Used for getting innerHTML like it's done in JavaScript:.
92+
*
9093
* @code
9194
* $string = $div->innerHTML;
9295
* @endcode
@@ -105,7 +108,7 @@ public function __get($name)
105108
$trace = debug_backtrace();
106109
trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_NOTICE);
107110

108-
return null;
111+
return;
109112
}
110113

111114
public function __toString()

0 commit comments

Comments
 (0)