From e511264e687e2e5f48610155c0eb631ed480c9bd Mon Sep 17 00:00:00 2001 From: Chris Johnson Date: Wed, 15 Aug 2018 18:26:02 -0500 Subject: [PATCH 1/3] Fix invalid JSON. First line contained non-ASCII hidden characters which were invalid. --- src/Formatter/Locale/deDE.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formatter/Locale/deDE.json b/src/Formatter/Locale/deDE.json index cf7764f..ce48e91 100644 --- a/src/Formatter/Locale/deDE.json +++ b/src/Formatter/Locale/deDE.json @@ -1,4 +1,4 @@ -{ +{ "thousands_separator": ".", "decimal_separator": ",", "currency": "€", From 8ae5de79fd3232484c4c69c7f1f23e999e6b105f Mon Sep 17 00:00:00 2001 From: Tom Butler Date: Thu, 16 Aug 2018 14:05:24 +0100 Subject: [PATCH 2/3] Update composer.json to require php 7 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 937f955..7090ae4 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": ">=5.6.0" + "php": ">=7.0.0" }, "require-dev": { "phpunit/phpunit": "^5.7.20" From 04d6e08604d8b0dac0a7494c3faf925a0158b98e Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 7 Sep 2018 13:33:23 -0400 Subject: [PATCH 3/3] Fix issue where pseudo was still being counted towards depth --- src/Parser/CssToXpath.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Parser/CssToXpath.php b/src/Parser/CssToXpath.php index d60b19e..7b26efb 100644 --- a/src/Parser/CssToXpath.php +++ b/src/Parser/CssToXpath.php @@ -103,9 +103,11 @@ private function removeSpacesFromDirectDecend($css) { public function getDepth($css) { - return count($this->split($css)); + $parts = $css->splitOnToken(Tokenizer::COLON); + return count($this->split($parts[0])); } + public function getPseudo($css) { $parts = $css->splitOnToken(Tokenizer::COLON); array_shift($parts);