Esempio n. 1
0
 /**
  * Writes the given item to the given writer if the no filter is given or the filter returns `true`.
  *
  * @param mixed      $item
  * @param WriterPipe $pipe
  *
  * @return bool `true` if the item has been written, `false` if not.
  */
 protected function writeItem($item, WriterPipe $pipe)
 {
     if ($pipe->getFilter() === null || $pipe->getFilter()->filter($item) === true) {
         $pipe->getWriter()->writeItem($item);
         return true;
     }
     return false;
 }