original_string: protected function filterElements(Collection $collection, AdminMenu $parent = null)
      {
          $children = $collection->filter(function (AdminMenu $menuItem) use ($parent) {
              return $menuItem->getParent() === $parent;
          });
          
          return $children;
      }
code: protected function filterElements(Collection $collection, AdminMenu $parent = null)
      {
          $children = $collection->filter(function (AdminMenu $menuItem) use ($parent) {
              return $menuItem->getParent() === $parent;
          });
          
          return $children;
      }
code_tokens: protected function filterElements ( Collection $ collection , AdminMenu $ parent = null ) { $ children = $ collection -> filter ( function ( AdminMenu $ menuItem ) use ( $ parent ) { return $ menuItem -> getParent ( ) === $ parent ; } ) ; return $ children ; }
docstring: Filters the collection and returns only children elements for given parent element
  
  @param Collection     $collection
  @param AdminMenu|null $parent
  
  @return Collection
docstring_tokens: Filters the collection and returns only children elements for given parent element