callback = $callback; $this->context = $context; } /** * Return the data types that this transformer is compatible with. * * @return DataType[] */ public function compatibility() : array { return DataType::all(); } /** * Transform the dataset in place. * * @param array $samples */ public function transform(array &$samples) : void { array_walk($samples, $this->callback, $this->context); } /** * Return the string representation of the object. * * @internal * * @return string */ public function __toString() : string { return 'Lambda Function'; } }