src/Template/Renderer.php
protected function check(array $files, $path, $source, $template)
    {
        $file = null;

        foreach ((array) $files as $key => $value) {
            $filepath = (string) str_replace($path, $source, $value);

            $filepath = str_replace('\\', '/', (string) $filepath);

            $filepath = (string) preg_replace('/^\d\//i', '', $filepath);

            $exists = (string) $filepath === $template;

            $lowercase = strtolower($filepath) === $template;

            ($exists || $lowercase) && $file = $value;
        }

        return $file;
    }
protected function check(array $files, $path, $source, $template)
    {
        $file = null;

        foreach ((array) $files as $key => $value) {
            $filepath = (string) str_replace($path, $source, $value);

            $filepath = str_replace('\\', '/', (string) $filepath);

            $filepath = (string) preg_replace('/^\d\//i', '', $filepath);

            $exists = (string) $filepath === $template;

            $lowercase = strtolower($filepath) === $template;

            ($exists || $lowercase) && $file = $value;
        }

        return $file;
    }
Checks if the specified file exists.

@param  array          $files
@param  string         $path
@param  string|integer $source
@param  string         $template
@return string|null