From b792a6cc7bcd953005edfba3edbab69fb80b3141 Mon Sep 17 00:00:00 2001 From: Fonata Date: Mon, 6 Jan 2020 18:04:45 +0100 Subject: [PATCH] Code quality: Removed superfluous brackets; should not change anything --- src/Csv.php | 2 +- tests/methods/HasToString.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/methods/HasToString.php diff --git a/src/Csv.php b/src/Csv.php index eee55de..319265f 100644 --- a/src/Csv.php +++ b/src/Csv.php @@ -1137,7 +1137,7 @@ class Csv { : ''; $enclosure_quoted = preg_quote($this->enclosure, '/'); $pattern = "/" . $delimiter_quoted . $enclosure_quoted . "|\n|\r/i"; - if ($this->enclose_all || preg_match($pattern, $value) || (strpos($value, ' ') === 0 || substr($value, -1) == ' ')) { + if ($this->enclose_all || preg_match($pattern, $value) || strpos($value, ' ') === 0 || substr($value, -1) == ' ') { $value = str_replace($this->enclosure, $this->enclosure . $this->enclosure, $value); $value = $this->enclosure . $value . $this->enclosure; } diff --git a/tests/methods/HasToString.php b/tests/methods/HasToString.php new file mode 100644 index 0000000..9c17166 --- /dev/null +++ b/tests/methods/HasToString.php @@ -0,0 +1,9 @@ +