Fallback delimiter should be const

This commit is contained in:
QWp6t
2016-12-08 15:55:16 -08:00
parent e3546ce5d7
commit b3ebd1f698

View File

@@ -4,8 +4,7 @@ namespace Roots\Sage\Template;
class FileViewFinder extends \Illuminate\View\FileViewFinder
{
public $possible_parts_delimiter = '-';
const FALLBACK_PARTS_DELIMITER = '-';
/**
* Get an array of possible view files.
@@ -15,10 +14,10 @@ class FileViewFinder extends \Illuminate\View\FileViewFinder
*/
protected function getPossibleViewFiles($name)
{
$parts = explode($this->possible_parts_delimiter, $name);
$parts = explode(self::FALLBACK_PARTS_DELIMITER, $name);
$templates[] = array_shift($parts);
foreach ($parts as $i => $part) {
$templates[] = $templates[$i].$this->possible_parts_delimiter.$part;
$templates[] = $templates[$i].self::FALLBACK_PARTS_DELIMITER.$part;
}
rsort($templates);
return call_user_func_array('array_merge', array_map(function ($template) {