for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* CSVelte: Slender, elegant CSV for PHP
* Inspired by Python's CSV module and Frictionless Data and the W3C's CSV
* standardization efforts, CSVelte was written in an effort to take all the
* suck out of working with CSV.
*
* @version {version}
* @copyright Copyright (c) 2016 Luke Visinoni <[email protected]>
* @author Luke Visinoni <[email protected]>
* @license https://github.com/deni-zen/csvelte/blob/master/LICENSE The MIT License (MIT)
*/
namespace CSVelte\Collection;
use function CSVelte\is_traversable;
class Collection extends AbstractCollection
{
/**
* Is correct input data type?
* @param mixed $data The data to assert correct type of
* @return bool
protected function isConsistentDataStructure($data)
// this collection may only contain scalar or null values
if (!is_traversable($data)) {
return false;
}
foreach ($data as $key => $val) {
if (is_traversable($val)) {
return true;