concrete/src/Express/Formatter/LabelFormatter.php
public function format($mask, callable $matchHandler)
    {
        try {
            // Run a regular expression to match the mask
            return preg_replace_callback('/%(.*?)%/i', function ($matches) use ($matchHandler) {
                // Return the result returned from the matchHandler
                return $this->getResult($matches[1], $matchHandler) ?: '';
            }, $mask);
        } catch (\Exception $e) {
            // Log any failures
            $this->logger->debug(
                'Failed to format express mask "{mask}": {message}',
                ['mask' => $mask, 'message' => $e->getMessage(), 'exception' => $e]
            );
        }
    }
public function format($mask, callable $matchHandler)
    {
        try {
            // Run a regular expression to match the mask
            return preg_replace_callback('/%(.*?)%/i', function ($matches) use ($matchHandler) {
                // Return the result returned from the matchHandler
                return $this->getResult($matches[1], $matchHandler) ?: '';
            }, $mask);
        } catch (\Exception $e) {
            // Log any failures
            $this->logger->debug(
                'Failed to format express mask "{mask}": {message}',
                ['mask' => $mask, 'message' => $e->getMessage(), 'exception' => $e]
            );
        }
    }
public function format ( $ mask , callable $ matchHandler ) { try { // Run a regular expression to match the mask return preg_replace_callback ( '/%(.*?)%/i' , function ( $ matches ) use ( $ matchHandler ) { // Return the result returned from the matchHandler return $ this -> getResult ( $ matches [ 1 ] , $ matchHandler ) ? : '' ; } , $ mask ) ; } catch ( \ Exception $ e ) { // Log any failures $ this -> logger -> debug ( 'Failed to format express mask "{mask}": {message}' , [ 'mask' => $ mask , 'message' => $ e -> getMessage ( ) , 'exception' => $ e ] ) ; } }
Format a mask using the standard format given a callable

Ex: if you have attributes with handles `student_first_name` and `student_last_name`
`%student_last_name%, %student_first_name%`

@param $mask
@param callable $matchHandler
@return mixed
Format a mask using the standard format given a callable