From c3cf64f02424f6fc1a0a4f1164217caf89336ce4 Mon Sep 17 00:00:00 2001 From: mscherer Date: Tue, 2 Jan 2024 16:10:38 +0100 Subject: [PATCH] Minor cleanup and some typos. --- src/View/CsvView.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/View/CsvView.php b/src/View/CsvView.php index 88b1d3b..571dc0b 100644 --- a/src/View/CsvView.php +++ b/src/View/CsvView.php @@ -226,7 +226,7 @@ protected function _renderContent(): void foreach ((array)$serialize as $viewVar) { if (is_scalar($this->viewVars[$viewVar])) { - throw new CakeException("'" . $viewVar . "' is not an array or iteratable object."); + throw new CakeException("'" . $viewVar . "' is not an array or iterable object."); } foreach ($this->viewVars[$viewVar] as $_data) { @@ -250,7 +250,7 @@ protected function _renderContent(): void [$path, $format] = $formatter; } - if (strpos($path, '.') === false) { + if (!str_contains($path, '.')) { $value = $_data[$path]; } else { $value = Hash::get($_data, $path); @@ -271,7 +271,7 @@ protected function _renderContent(): void /** * Aggregates the rows into a single csv * - * @param array|null $row Row data + * @param array|null $row Row data * @return string CSV with all data to date */ protected function _renderRow(?array $row = null): string @@ -293,7 +293,7 @@ protected function _renderRow(?array $row = null): string /** * Generates a single row in a csv from an array of * data by writing the array to a temporary file and - * returning it's contents + * returning its contents * * @param array|null $row Row data * @return string|false String with the row in csv-syntax, false on fputscv failure @@ -302,7 +302,7 @@ protected function _generateRow(?array $row = null): string|false { static $fp = false; - if (empty($row)) { + if (!$row) { return ''; }