public function __invoke($data, $context = null) { if (!is_array($data = parent::__invoke($data, $context))) { return null; } return array_filter($data, $this->callback ?: function ($value) { return $value !== null; }); }
public function __invoke($data, $context = null) { $depth = $this->depth; $structure = parent::__invoke($data, $context); while (is_array($structure) && $depth--) { $structure = reset($structure); } return $structure; }
public function __invoke($data, $context = null) { if (!is_array($collection = parent::__invoke($data, $context))) { return null; } return array_map(function ($context) use($data) { return $this->delegate($this->transformation, $data, $context); }, $collection); }
public function __invoke($data, $context = null) { return parent::__invoke($data, $this->delegate($this->expression, $data, $context)); }
public function __invoke($data, $context = null) { return array_merge((array) parent::__invoke($data, $context), (array) $this->delegate($this->second, $data, $context)); }