public function getMapper()
    {
        $map = $this->getMap();

        return function ($path) use ($map) {
            foreach ($map as $item) {
                foreach ($item as $match => $replace) {
                    if (empty($match)) {
                        return $replace . $path;
                    } elseif (0 === strpos($path, $match)) {
                        return preg_replace(
                            '/^' . preg_quote($match, '/') . '/',
                            $replace,
                            $path
                        );
                    }
                }
            }

            return null;
        };
    }
public function getMapper()
    {
        $map = $this->getMap();

        return function ($path) use ($map) {
            foreach ($map as $item) {
                foreach ($item as $match => $replace) {
                    if (empty($match)) {
                        return $replace . $path;
                    } elseif (0 === strpos($path, $match)) {
                        return preg_replace(
                            '/^' . preg_quote($match, '/') . '/',
                            $replace,
                            $path
                        );
                    }
                }
            }

            return null;
        };
    }
public function getMapper ( ) { $ map = $ this -> getMap ( ) ; return function ( $ path ) use ( $ map ) { foreach ( $ map as $ item ) { foreach ( $ item as $ match => $ replace ) { if ( empty ( $ match ) ) { return $ replace . $ path ; } elseif ( 0 === strpos ( $ path , $ match ) ) { return preg_replace ( '/^' . preg_quote ( $ match , '/' ) . '/' , $ replace , $ path ) ; } } } return null ; } ; }
Returns a mapping callable for the configured map.

@return callable The mapping callable.
Returns a mapping callable for the configured map .