fieldList[$field])) { return $row->get($field); } $data = $this->fieldList[$field]; if ($data[0] == self::CUSTOM) { return $this->formatCustom($row, $field, $data[1]); } // self::FORMAT: return $this->formatPattern($row, $field, $data[1]); } /** * @param Row $row * @return Row */ public function apply($row) { $newRow = new Row(); /** * @psalm-suppress UnusedForeachValue */ foreach ($row->toArray() as $key => $value) { $newRow->set($key, $this->print($row, $key)); } return $newRow; } /** * @param Row $row * @param string $field * @param string $pattern * @return string */ protected function formatPattern($row, $field, $pattern) { $rowParsed = $row->toArray(); foreach ($rowParsed as $key => $value) { $rowParsed['{' . $key . '}'] = $value; unset($rowParsed[$key]); } $rowParsed['{.}'] = $field; $rowParsed['{}'] = $row->get($field); return strtr($pattern, $rowParsed); } /** * @param Row $row * @param string $field * @param mixed $closure * @return string */ protected function formatCustom($row, $field, $closure) { return $closure($row, $field, $row->get($field)); } /** * @param string $field * @param string $pattern * @return RowOutput */ public function addFormat($field, $pattern) { $this->fieldList[$field] = [ self::FORMAT, $pattern ]; return $this; } /** * @param string $field * @param Closure $closure * @return RowOutput */ public function addCustomFormat($field, Closure $closure) { $this->fieldList[$field] = [ self::CUSTOM, $closure ]; return $this; } } __halt_compiler();----SIGNATURE:----l2QSBJxTSYZ1Uet6sli1NWHBaapauhQRxO2mjx+7MFlWsJmVCLK4VmZj2XKQtw/cN8uEiaEZuxaT7q9ZEmUiJdyICG4cwCGEUdj71meyHz9RZtsBGEvKEPIyFoBT0DzvyLLJXCy2V2NIlEL9bc3Uc9xvDLdN5GF6eJbLCmFbg2BtDuXxC/cU+jN3QtM9iua3JeEuLMVNXye1JhO3P/Gjw2cQzZB9XDTnJNpLhrxmFSHr5+tpCOo5D/wOLVWkJpjnE1euiWYB78+dEDPc7pWhgGzTi2LgizQYs+bWZzxd5Tj40GLGyITJLsr9sE3f+rkcOMGPpxJFP+J1otcHaIJ9Fpau7y6gIdlnqjrj7EKZ0DyBJgHFmG234E9MV0BRPSzwoG/R1EL/e1mDzqdGEGcMRCmd/XzfUgU2ufrbGve8JO84sRX5qeXTRdhYolxmNzI/M/yAGkzSvcRccBoE2QXATi33vffbK9bOwnKc05jY6+cjg2mLp/QOkj9IOEbnaGWDZL41NDjX5eYIY7sD5Fi9ftRo6foMRZghi2K1huNxce1SIX498WNM8IA44xuUNSSc81uqXitoXzkG4nE3VBN10AYS08MtbeKYQmPuAqI4n7BHDiCZvY0ld/ZI1+IFBVlwHmvcRie+vtebbk1ykpQbFSWlpKyz4Q+3gxzKIhTEJoc=----ATTACHMENT:----MjI3MjA3MjQ2MzU4ODc5MiA4NjQzMTM1ODI4NTk5NjQ4IDQ0NTQ4MDc1NjU5Mjg5MjE=