@@ -53,7 +53,7 @@ class FileViewFinder implements ViewFinderInterface
53
53
public function __construct (Filesystem $ files , array $ paths , array $ extensions = null )
54
54
{
55
55
$ this ->files = $ files ;
56
- $ this ->paths = array_map ([$ this , 'normalizePath ' ], $ paths );
56
+ $ this ->paths = array_map ([$ this , 'resolvePath ' ], $ paths );
57
57
58
58
if (isset ($ extensions )) {
59
59
$ this ->extensions = $ extensions ;
@@ -158,7 +158,7 @@ protected function getPossibleViewFiles($name)
158
158
*/
159
159
public function addLocation ($ location )
160
160
{
161
- $ this ->paths [] = $ this ->normalizePath ($ location );
161
+ $ this ->paths [] = $ this ->resolvePath ($ location );
162
162
}
163
163
164
164
/**
@@ -169,7 +169,18 @@ public function addLocation($location)
169
169
*/
170
170
public function prependLocation ($ location )
171
171
{
172
- array_unshift ($ this ->paths , $ this ->normalizePath ($ location ));
172
+ array_unshift ($ this ->paths , $ this ->resolvePath ($ location ));
173
+ }
174
+
175
+ /**
176
+ * Resolve the path.
177
+ *
178
+ * @param string $path
179
+ * @return string
180
+ */
181
+ protected function resolvePath ($ path )
182
+ {
183
+ return realpath ($ path ) ?: $ path ;
173
184
}
174
185
175
186
/**
@@ -295,15 +306,4 @@ public function getExtensions()
295
306
{
296
307
return $ this ->extensions ;
297
308
}
298
-
299
- /**
300
- * Replace unnecessary relative fragments from the absolute view path.
301
- *
302
- * @param string $path
303
- * @return string
304
- */
305
- protected function normalizePath ($ path )
306
- {
307
- return realpath ($ path ) ?: $ path ;
308
- }
309
309
}
0 commit comments