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 ''; }