From 3185dc9c8f0f82d0d1daf7cf0cb8422b9428dd8b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 20 Mar 2017 10:41:03 +0100 Subject: [PATCH] [Yaml] CS --- src/Symfony/Component/Yaml/Parser.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index 7f5c9baef1..345bcbdac1 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -257,7 +257,7 @@ class Parser return $value; } - throw new ParseException('Unable to parse', $this->getRealCurrentLineNb() + 1, $this->currentLine); + throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine); } } @@ -636,10 +636,7 @@ class Parser return false; } - $ret = false; - if ($this->getCurrentLineIndentation() > $currentIndentation) { - $ret = true; - } + $ret = $this->getCurrentLineIndentation() > $currentIndentation; $this->moveToPreviousLine(); @@ -740,14 +737,7 @@ class Parser return false; } - $ret = false; - if ( - $this->getCurrentLineIndentation() == $currentIndentation - && - $this->isStringUnIndentedCollectionItem() - ) { - $ret = true; - } + $ret = $this->getCurrentLineIndentation() === $currentIndentation && $this->isStringUnIndentedCollectionItem(); $this->moveToPreviousLine(); @@ -789,8 +779,7 @@ class Parser */ public static function preg_match($pattern, $subject, &$matches = null, $flags = 0, $offset = 0) { - $ret = preg_match($pattern, $subject, $matches, $flags, $offset); - if ($ret === false) { + if (false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) { switch (preg_last_error()) { case PREG_INTERNAL_ERROR: $error = 'Internal PCRE error.';