Skip to content

Commit

Permalink
Review code quality
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme TAMARELLE <[email protected]>
  • Loading branch information
GromNaN committed Feb 20, 2020
1 parent 36ded5a commit 8572ffd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
}
],
"require": {
"php": ">=7.2.0"
"php": ">=7.2.0",
"ext-dom": "*",
"ext-xsl": "*",
"ext-libxml": "*"
},
"suggest": {
"symfony/css-selector": "Provides facilities is you prefers CSS to Xpath"
Expand Down
14 changes: 7 additions & 7 deletions src/Welldom/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static public function create($source, $encoding = null, $version = null)
* Factory.
* Create a document from a DOMNode.
*
* @param \Welldom\DOMNode $node
* @param \Welldom\NodeInterface $node
* @param bool $deep When false, $node subtree is not imported.
* @return \Welldom\Document
*/
Expand Down Expand Up @@ -242,10 +242,10 @@ public function validate()
*
* @return boolean
*/
public function schemaValidate($filename)
public function schemaValidate($filename, $options = null)
{
XmlErrorHandler::start();
$valid = parent::schemaValidate($filename);
$valid = parent::schemaValidate($filename, $options);
$this->lastErrors = XmlErrorHandler::getErrors();
XmlErrorHandler::clean();

Expand All @@ -257,10 +257,10 @@ public function schemaValidate($filename)
*
* @return boolean
*/
public function schemaValidateSource($source)
public function schemaValidateSource($source, $flags)
{
XmlErrorHandler::start();
$valid = parent::schemaValidateSource($source);
$valid = parent::schemaValidateSource($source, $flags);
$this->lastErrors = XmlErrorHandler::getErrors();
XmlErrorHandler::clean();

Expand Down Expand Up @@ -459,7 +459,7 @@ public function getNodeValue($expression, $default = false)
*
* @param string $expression
* @param string $value
* @return \Welldom\Node
* @return \Welldom\NodeInterface
*/
public function setNodeValue($expression, $value = null)
{
Expand Down Expand Up @@ -530,7 +530,7 @@ public function getNodeInnerXml($expression, $default = false)
* @param string $expression
* @param string $xml
* @param boolean $append
* @return \Welldom\Node
* @return \Welldom\NodeInterface
*/
public function setNodeInnerXml($expression, $xml, $append = false)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Welldom/DocumentFragment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Welldom;

use Welldom\Exception\XmlLoadingException;

/**
* DOM Document Fragment extension.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Welldom/Xpath.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function query($expression, \DOMNode $contextnode = null, $registerNodeNS
* @param string $expression Xpath expression
* @param \DOMNode $contextnode
* @param bool $registerNodeNS
* @return \Welldom\Node The node found or FALSE if the number of results is not 1
* @return \Welldom\NodeInterface|false The node found or FALSE if the number of results is not 1
* @throws \Welldom\Exception\InvalidXpathException
*/
public function queryOne($expression, \DOMNode $contextnode = null, $registerNodeNS = true)
Expand Down
4 changes: 2 additions & 2 deletions src/Welldom/XsltProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function transformToXml(\DOMNode $node, array $parameters = array())
{
$this->preTransform($parameters);
$xml = $this->processor->transformToXml($node);
$this->postTransform($parameters);
$this->postTransform();

if (false === $xml) {
return false;
Expand Down Expand Up @@ -166,7 +166,7 @@ public function removeParameter(array $name)
/**
* Removes a list of parameters.
*
* @param type $names List of names
* @param string[] $names List of names
* @return \Welldom\XsltProcessor
*/
public function removeParameters(array $names)
Expand Down

0 comments on commit 8572ffd

Please sign in to comment.