Skip to content

Commit

Permalink
Merge pull request #19 from php-cache/bugfix2
Browse files Browse the repository at this point in the history
Better option validation for filesystem
  • Loading branch information
Nyholm committed Jan 20, 2016
2 parents 8cd1e4d + 9b88a4f commit 04b087f
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 04b087f

Please sign in to comment.