Skip to content

Commit

Permalink
Better option validation for filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Jan 20, 2016
1 parent 8cd1e4d commit 9b88a4f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Factory/FilesystemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,16 @@ class FilesystemFactory extends AbstractAdapterFactory
*/
public function getAdapter(array $config)
{
return new FilesystemCachePool($config['flysystem']);
return new FilesystemCachePool($config['flysystem_service']);
}

/**
* {@inheritdoc}
*/
protected static function configureOptionResolver(OptionsResolver $resolver)
{
$resolver->setDefaults([
'flysystem_service' => null,
]);
$resolver->setRequired(['flysystem_service']);

$resolver->setAllowedTypes('host', ['string', 'object']);
$resolver->setAllowedTypes('flysystem_service', ['string', 'object']);
}
}

0 comments on commit 9b88a4f

Please sign in to comment.