src/Adapter/Goodby/Exporter.php
/**
     * Check if the column count is consistent with comparing other rows.
     *
     * @param array $row The row to check consistency for
     *
     * @return void
     * @throws \Goodby\CSV\Export\Standard\Exception\StrictViolationException Is thrown, if row consistency check fails
     */
Check if the column count is consistent with comparing other rows.
@param array $row The row to check consistency for


Check if the column count is consistent with comparing other rows . @param array $row The row to check consistency for
private function checkRowConsistency(array $row)
    {
        if ($this->isNotStrict()) {
            return;
        }
        $current = count($row);
        if ($this->rowConsistency === null) {
            $this->rowConsistency = $current;
        }
        if ($current !== $this->rowConsistency) {
            throw new StrictViolationException(sprintf('Column size should be %u, but %u columns given', $this->rowConsistency, $current));
        }
        $this->rowConsistency = $current;
    }
private function checkRowConsistency ( array $ row ) { if ( $ this -> isNotStrict ( ) ) { return ; } $ current = count ( $ row ) ; if ( $ this -> rowConsistency === null ) { $ this -> rowConsistency = $ current ; } if ( $ current !== $ this -> rowConsistency ) { throw new StrictViolationException ( sprintf ( 'Column size should be %u, but %u columns given' , $ this -> rowConsistency , $ current ) ) ; } $ this -> rowConsistency = $ current ; }
Check if the column count is consistent with comparing other rows.
Check if the column count is consistent with comparing other rows .
// query whether or not strict mode is enabled // count the number of columns // if the row consistency has not been set, set it // check row consistency // set the new row consistency