original_string: protected function setDataSource($dataSource)
      {
          if (is_array($dataSource) || $dataSource instanceof \Traversable) {
              foreach ($dataSource as $value) {
                  $this->internalDataListData[] = $value;
              }
              return;
          }
          if (is_callable($dataSource)) {
              $this->internalDataListData = $dataSource;
              return;
          }
          throw new \InvalidArgumentException('The data argument must be iterable or a callback that returns such data.');
      }
code: protected function setDataSource($dataSource)
      {
          if (is_array($dataSource) || $dataSource instanceof \Traversable) {
              foreach ($dataSource as $value) {
                  $this->internalDataListData[] = $value;
              }
              return;
          }
          if (is_callable($dataSource)) {
              $this->internalDataListData = $dataSource;
              return;
          }
          throw new \InvalidArgumentException('The data argument must be iterable or a callback that returns such data.');
      }
code_tokens: protected function setDataSource ( $ dataSource ) { if ( is_array ( $ dataSource ) || $ dataSource instanceof \ Traversable ) { foreach ( $ dataSource as $ value ) { $ this -> internalDataListData [ ] = $ value ; } return ; } if ( is_callable ( $ dataSource ) ) { $ this -> internalDataListData = $ dataSource ; return ; } throw new \ InvalidArgumentException ( 'The data argument must be iterable or a callback that returns such data.' ) ; }
docstring: Sets a new data source for the list.
  
  @param array|iterable|callback $dataSource An array or an iterable containing objects or arrays that will be converted into data objects or a callback that returns such. The callback option enables lazy data loading.
  @throws \InvalidArgumentException
docstring_tokens: Sets a new data source for the list .