Pinq\Collection::apply PHP Метод

apply() публичный Метод

public apply ( callable $function )
$function callable
    public function apply(callable $function)
    {
        if ($this->source !== null) {
            $this->scheme->walk($this->elements, $function);
        } else {
            $this->toOrderedMap()->walk($function);
        }
    }

Usage Example

 /**
  * @param string $code
  * @return string
  */
 private function applyFilters(string $code) : string
 {
     $this->filters->apply(function ($filter) use(&$code) {
         $code = $filter($code);
     });
     return $code;
 }