Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
[PSR-2] fixers=braces,elseif,short_tag,php_closing_tag,trailing_space…
Browse files Browse the repository at this point in the history
…s,linefeed

Applied php-cs-fixer --fixers=braces,elseif,short_tag,php_closing_tag,trailing_spaces,linefeed
  • Loading branch information
Maks3w committed Jul 12, 2012
1 parent 74f8e99 commit 1fa8900
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/Css2Xpath.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function ($matches) {
$expression = preg_replace_callback(
'|\[([a-z0-9_-]+)~=[\'"]([^\'"]+)[\'"]\]|i',
function ($matches) {
return "[contains(concat(' ', normalize-space(@" . strtolower($matches[1]) . "), ' '), ' "
return "[contains(concat(' ', normalize-space(@" . strtolower($matches[1]) . "), ' '), ' "
. $matches[2] . " ')]";
},
$expression
Expand All @@ -110,16 +110,16 @@ function ($matches) {
$expression = preg_replace_callback(
'|\[([a-z0-9_-]+)\*=[\'"]([^\'"]+)[\'"]\]|i',
function ($matches) {
return "[contains(@" . strtolower($matches[1]) . ", '"
return "[contains(@" . strtolower($matches[1]) . ", '"
. $matches[2] . "')]";
},
$expression
);

// Classes
$expression = preg_replace(
'|\.([a-z][a-z0-9_-]*)|i',
"[contains(concat(' ', normalize-space(@class), ' '), ' \$1 ')]",
'|\.([a-z][a-z0-9_-]*)|i',
"[contains(concat(' ', normalize-space(@class), ' '), ' \$1 ')]",
$expression
);

Expand Down
4 changes: 2 additions & 2 deletions src/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Query
* @var array
*/
protected $xpathNamespaces = array();

/**
* XPath PHP Functions
* @var mixed
Expand Down Expand Up @@ -278,7 +278,7 @@ public function registerXpathNamespaces($xpathNamespaces)

/**
* Register PHP Functions to use in internal DOMXPath
*
*
* @param mixed $restrict
* @return void
*/
Expand Down
16 changes: 8 additions & 8 deletions test/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function loadHtml()
$this->query->setDocument($this->getHtml());
}

public function handleError($msg, $code = 0)
public function handleError($msg, $code = 0)
{
$this->error = $msg;
}
Expand Down Expand Up @@ -205,8 +205,8 @@ public function testXpathPhpFunctionsShouldBeEnableWithoutParameter()
$this->loadHtml();
$this->query->registerXpathPhpFunctions();
$result = $this->query->queryXpath('//meta[php:functionString("strtolower", @http-equiv) = "content-type"]');
$this->assertEquals('content-type',
strtolower($result->current()->getAttribute('http-equiv')),
$this->assertEquals('content-type',
strtolower($result->current()->getAttribute('http-equiv')),
$result->getXpathQuery());
}

Expand Down Expand Up @@ -235,7 +235,7 @@ public function testLoadingDocumentWithErrorsShouldNotRaisePhpErrors()
$this->assertTrue(is_array($errors));
$this->assertTrue(0 < count($errors));
}

/**
* @group ZF-9765
*/
Expand Down Expand Up @@ -272,7 +272,7 @@ public function testAllowsSpecifyingEncodingAtConstruction()
$doc = new Query($this->getHtml(), 'iso-8859-1');
$this->assertEquals('iso-8859-1', $doc->getEncoding());
}

/**
* @group ZF-3938
*/
Expand All @@ -281,7 +281,7 @@ public function testAllowsSpecifyingEncodingWhenSettingDocument()
$this->query->setDocument($this->getHtml(), 'iso-8859-1');
$this->assertEquals('iso-8859-1', $this->query->getEncoding());
}

/**
* @group ZF-3938
*/
Expand All @@ -295,7 +295,7 @@ public function testAllowsSpecifyingEncodingViaSetter()
* @group ZF-3938
*/
public function testSpecifyingEncodingSetsEncodingOnDomDocument()
{
{
$this->query->setDocument($this->getHtml(), 'utf-8');
$test = $this->query->execute('.foo');
$this->assertInstanceof('\\Zend\\Dom\\NodeList', $test);
Expand Down Expand Up @@ -327,7 +327,7 @@ public function testXhtmlDocumentWithXmlAndDoctypeDeclaration()
{
$xhtmlWithXmlDecl = <<<EOB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Expand Down

0 comments on commit 1fa8900

Please sign in to comment.