File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
src/Illuminate/Filesystem Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ function (&$parent) use ($config) {
328
328
* @param array $config
329
329
* @return \League\Flysystem\FilesystemOperator
330
330
*/
331
- protected function createFlysystem (FlysystemAdapter $ adapter , array $ config )
331
+ protected function createFlysystem (FlysystemAdapter & $ adapter , array $ config )
332
332
{
333
333
if (($ config ['read-only ' ] ?? false ) === true ) {
334
334
$ adapter = new ReadOnlyFilesystemAdapter ($ adapter );
Original file line number Diff line number Diff line change 6
6
use Illuminate \Filesystem \FilesystemManager ;
7
7
use Illuminate \Foundation \Application ;
8
8
use InvalidArgumentException ;
9
+ use League \Flysystem \PathPrefixing \PathPrefixedAdapter ;
9
10
use League \Flysystem \UnableToReadFile ;
10
11
use PHPUnit \Framework \Attributes \RequiresOperatingSystem ;
11
12
use PHPUnit \Framework \TestCase ;
@@ -211,4 +212,24 @@ public function testCanBuildInlineScopedDisks()
211
212
rmdir (__DIR__ .'/../../to-be-scoped ' );
212
213
}
213
214
}
215
+
216
+ public function testKeepTrackOfAdapterDecoration ()
217
+ {
218
+ $ filesystem = new FilesystemManager (tap (new Application , function ($ app ) {
219
+ $ app ['config ' ] = [
220
+ 'filesystems.disks.local ' => [
221
+ 'driver ' => 'local ' ,
222
+ 'root ' => 'to-be-scoped ' ,
223
+ ],
224
+ ];
225
+ }));
226
+
227
+ $ scoped = $ filesystem ->build ([
228
+ 'driver ' => 'scoped ' ,
229
+ 'disk ' => 'local ' ,
230
+ 'prefix ' => 'path-prefix ' ,
231
+ ]);
232
+
233
+ $ this ->assertInstanceOf (PathPrefixedAdapter::class, $ scoped ->getAdapter ());
234
+ }
214
235
}
You can’t perform that action at this time.
0 commit comments