Skip to content

Commit 1fd419b

Browse files
authored
Merge pull request #150 from Masterminds/backport
Backport few changes from old master branch
2 parents c7105a8 + c9b9079 commit 1fd419b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/HTML5.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ public function parseFragment($input, array $options = array())
201201
*
202202
* @param mixed $dom
203203
* The DOM to be serialized.
204-
* @param string $file
205-
* The filename to be written.
204+
* @param string|resource $file
205+
* The filename to be written or resource to write to.
206206
* @param array $options
207207
* Configuration options when serializing the DOM. These include:
208208
* - encode_entities: Text written to the output is escaped by default and not all

src/HTML5/Elements.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ public static function isElement($name)
557557
* @param string $name
558558
* The name of the element.
559559
*
560-
* @return int|bool The element mask or false if element does not exist.
560+
* @return int The element mask.
561561
*/
562562
public static function element($name)
563563
{
@@ -571,7 +571,7 @@ public static function element($name)
571571
return static::$mathml[$name];
572572
}
573573

574-
return false;
574+
return 0;
575575
}
576576

577577
/**

src/HTML5/Serializer/Traverser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Traverser
1616
/**
1717
* Namespaces that should be treated as "local" to HTML5.
1818
*/
19-
static $local_ns = array(
19+
protected static $local_ns = array(
2020
'http://www.w3.org/1999/xhtml' => 'html',
2121
'http://www.w3.org/1998/Math/MathML' => 'math',
2222
'http://www.w3.org/2000/svg' => 'svg'

test/HTML5/ElementsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public function testElement()
351351
'baz'
352352
);
353353
foreach ($nonhtml5 as $element) {
354-
$this->assertFalse(Elements::element($element));
354+
$this->assertEquals(0, Elements::element($element));
355355
}
356356
}
357357

0 commit comments

Comments
 (0)