Skip to content

Commit

Permalink
Merge pull request #140 from FriendsOfCake/cleanup
Browse files Browse the repository at this point in the history
Minor cleanup and some typos.
  • Loading branch information
ADmad committed Jan 2, 2024
2 parents c2e539c + c3cf64f commit 01dade2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/View/CsvView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand All @@ -271,7 +271,7 @@ protected function _renderContent(): void
/**
* Aggregates the rows into a single csv
*
* @param array|null $row Row data
* @param array<string>|null $row Row data
* @return string CSV with all data to date
*/
protected function _renderRow(?array $row = null): string
Expand All @@ -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
Expand All @@ -302,7 +302,7 @@ protected function _generateRow(?array $row = null): string|false
{
static $fp = false;

if (empty($row)) {
if (!$row) {
return '';
}

Expand Down

0 comments on commit 01dade2

Please sign in to comment.