src/lib/KevinGH/Wisdom/Loader/Loader.php
public function doReplace($data)
    {
        $data = preg_replace_callback(
            '/#([^\s\r#]+)#/',
            function ($matches) {
                if (defined($matches[1])) {
                    return constant($matches[1]);
                }

                return $matches[0];
            },
            $data
        );

        if (isset($this->values)) {
            $values = $this->values;

            $data = preg_replace_callback(
                '/%([^\s\r%]+)%/',
                function ($matches) use ($values) {
                    if (isset($values[$matches[1]])) {
                        return $values[$matches[1]];
                    }

                    return $matches[0];
                },
                $data
            );
        }

        return $data;
    }
public function doReplace($data)
    {
        $data = preg_replace_callback(
            '/#([^\s\r#]+)#/',
            function ($matches) {
                if (defined($matches[1])) {
                    return constant($matches[1]);
                }

                return $matches[0];
            },
            $data
        );

        if (isset($this->values)) {
            $values = $this->values;

            $data = preg_replace_callback(
                '/%([^\s\r%]+)%/',
                function ($matches) use ($values) {
                    if (isset($values[$matches[1]])) {
                        return $values[$matches[1]];
                    }

                    return $matches[0];
                },
                $data
            );
        }

        return $data;
    }
public function doReplace ( $ data ) { $ data = preg_replace_callback ( '/#([^\s\r#]+)#/' , function ( $ matches ) { if ( defined ( $ matches [ 1 ] ) ) { return constant ( $ matches [ 1 ] ) ; } return $ matches [ 0 ] ; } , $ data ) ; if ( isset ( $ this -> values ) ) { $ values = $ this -> values ; $ data = preg_replace_callback ( '/%([^\s\r%]+)%/' , function ( $ matches ) use ( $ values ) { if ( isset ( $ values [ $ matches [ 1 ] ] ) ) { return $ values [ $ matches [ 1 ] ] ; } return $ matches [ 0 ] ; } , $ data ) ; } return $ data ; }
Performs the replacement on the raw data.

@param string $data The raw data.

@return string The replaced data.
Performs the replacement on the raw data .