Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor cleanup and some typos. #140

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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