lib/Psc/TPL/ContentStream/Converter.php
public function shiftFirstEntry(ContentStream $cs, $type, \Closure $withFilter = NULL) {
    if (($entry = $cs->findFirst($type, $withFilter)) != NULL) {
      $vars = $this->convertEntryTemplateVariables($entry, $cs);
      $cs->removeEntry($entry);

      return $vars;
    }

    return NULL;
  }
public function shiftFirstEntry(ContentStream $cs, $type, \Closure $withFilter = NULL) {
    if (($entry = $cs->findFirst($type, $withFilter)) != NULL) {
      $vars = $this->convertEntryTemplateVariables($entry, $cs);
      $cs->removeEntry($entry);

      return $vars;
    }

    return NULL;
  }
public function shiftFirstEntry ( ContentStream $ cs , $ type , \ Closure $ withFilter = NULL ) { if ( ( $ entry = $ cs -> findFirst ( $ type , $ withFilter ) ) != NULL ) { $ vars = $ this -> convertEntryTemplateVariables ( $ entry , $ cs ) ; $ cs -> removeEntry ( $ entry ) ; return $ vars ; } return NULL ; }
Finds the first occurence of the entry, removes it and returns the template Variables for it

if nothing is found NULL is returned
if entry is found it will be removed from content stream and its variables will be returned
if $withFilter is given the function has to return true to find the entry
@param Closure $withFilter function ($entry) should return TRUE if the filter matches
@return Scalar|NULL
Finds the first occurence of the entry removes it and returns the template Variables for it