Skip to content

Commit 9b88a4f

Browse files
committed
Better option validation for filesystem
1 parent 8cd1e4d commit 9b88a4f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Factory/FilesystemFactory.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,16 @@ class FilesystemFactory extends AbstractAdapterFactory
2828
*/
2929
public function getAdapter(array $config)
3030
{
31-
return new FilesystemCachePool($config['flysystem']);
31+
return new FilesystemCachePool($config['flysystem_service']);
3232
}
3333

3434
/**
3535
* {@inheritdoc}
3636
*/
3737
protected static function configureOptionResolver(OptionsResolver $resolver)
3838
{
39-
$resolver->setDefaults([
40-
'flysystem_service' => null,
41-
]);
39+
$resolver->setRequired(['flysystem_service']);
4240

43-
$resolver->setAllowedTypes('host', ['string', 'object']);
41+
$resolver->setAllowedTypes('flysystem_service', ['string', 'object']);
4442
}
4543
}

0 commit comments

Comments
 (0)