From 1fa890055664b04d804eca366a24f136e780447f Mon Sep 17 00:00:00 2001 From: Maks3w Date: Thu, 12 Jul 2012 21:11:36 +0200 Subject: [PATCH] [PSR-2] fixers=braces,elseif,short_tag,php_closing_tag,trailing_spaces,linefeed Applied php-cs-fixer --fixers=braces,elseif,short_tag,php_closing_tag,trailing_spaces,linefeed --- src/Css2Xpath.php | 8 ++++---- src/Query.php | 4 ++-- test/QueryTest.php | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Css2Xpath.php b/src/Css2Xpath.php index 861ef1f..edb6542 100644 --- a/src/Css2Xpath.php +++ b/src/Css2Xpath.php @@ -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 @@ -110,7 +110,7 @@ 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 @@ -118,8 +118,8 @@ function ($matches) { // 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 ); diff --git a/src/Query.php b/src/Query.php index 87e7dbe..efb4d45 100644 --- a/src/Query.php +++ b/src/Query.php @@ -57,7 +57,7 @@ class Query * @var array */ protected $xpathNamespaces = array(); - + /** * XPath PHP Functions * @var mixed @@ -278,7 +278,7 @@ public function registerXpathNamespaces($xpathNamespaces) /** * Register PHP Functions to use in internal DOMXPath - * + * * @param mixed $restrict * @return void */ diff --git a/test/QueryTest.php b/test/QueryTest.php index eb72f7c..1900ce3 100644 --- a/test/QueryTest.php +++ b/test/QueryTest.php @@ -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; } @@ -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()); } @@ -235,7 +235,7 @@ public function testLoadingDocumentWithErrorsShouldNotRaisePhpErrors() $this->assertTrue(is_array($errors)); $this->assertTrue(0 < count($errors)); } - + /** * @group ZF-9765 */ @@ -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 */ @@ -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 */ @@ -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); @@ -327,7 +327,7 @@ public function testXhtmlDocumentWithXmlAndDoctypeDeclaration() { $xhtmlWithXmlDecl = << -