private function locate($file)
    {
        if (isset($file[0]) && '@' === $file[0]) {
            if (false !== strpos($file, '..')) {
                throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $file));
            }

            $bundleName = substr($file, 1);
            $path       = '';
            if (false !== strpos($bundleName, '/')) {
                list($bundleName, $path) = explode('/', $bundleName, 2);
            }

            $bundle = $this->kernel->getBundle($bundleName);
            $file   = $bundle->getPath() . '/' . $path;
        }

        return $file;
    }
private function locate($file)
    {
        if (isset($file[0]) && '@' === $file[0]) {
            if (false !== strpos($file, '..')) {
                throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $file));
            }

            $bundleName = substr($file, 1);
            $path       = '';
            if (false !== strpos($bundleName, '/')) {
                list($bundleName, $path) = explode('/', $bundleName, 2);
            }

            $bundle = $this->kernel->getBundle($bundleName);
            $file   = $bundle->getPath() . '/' . $path;
        }

        return $file;
    }
private function locate ( $ file ) { if ( isset ( $ file [ 0 ] ) && '@' === $ file [ 0 ] ) { if ( false !== strpos ( $ file , '..' ) ) { throw new \ RuntimeException ( sprintf ( 'File name "%s" contains invalid characters (..).' , $ file ) ) ; } $ bundleName = substr ( $ file , 1 ) ; $ path = '' ; if ( false !== strpos ( $ bundleName , '/' ) ) { list ( $ bundleName , $ path ) = explode ( '/' , $ bundleName , 2 ) ; } $ bundle = $ this -> kernel -> getBundle ( $ bundleName ) ; $ file = $ bundle -> getPath ( ) . '/' . $ path ; } return $ file ; }
The implementation of this in FileLocator doesn't allow for files which don't exist, so this is a simple
reimplementation of that

@param $file
@return string
The implementation of this in FileLocator doesn t allow for files which don t exist so this is a simple reimplementation of that