src/Standard/View/CollectionView.php 1 location
|
@@ 24-29 (lines=6) @@
|
21 |
|
|
22 |
|
public function buildView(View $view, $data, array $options) |
23 |
|
{ |
24 |
|
if (!is_array($data) && !$data instanceof \Traversable) { |
25 |
|
throw new \InvalidArgumentException(sprintf( |
26 |
|
'Data must be traversable or an array, got: "%s"', |
27 |
|
is_object($data) ? get_class($data) : gettype($data) |
28 |
|
)); |
29 |
|
} |
30 |
|
|
31 |
|
if (is_array($data)) { |
32 |
|
$data = new \ArrayIterator($data); |
src/Standard/View/ScalarView.php 1 location
|
@@ 15-20 (lines=6) @@
|
12 |
|
{ |
13 |
|
public function buildView(View $view, $data, array $options) |
14 |
|
{ |
15 |
|
if (!is_scalar($data)) { |
16 |
|
throw new \InvalidArgumentException(sprintf( |
17 |
|
'Scalar view only accepts scalar values! Got "%s"', |
18 |
|
is_object($data) ? get_class($data) : gettype($data) |
19 |
|
)); |
20 |
|
} |
21 |
|
|
22 |
|
$view->setValue($data); |
23 |
|
} |