Skip to content

Commit e969d9d

Browse files
committed
Minor updates
1 parent 084b51a commit e969d9d

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

ClientFactory/ClientFactoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Http\HttplugBundle\Exception\ClientWasNotCreated;
77

88
/**
9-
* Interface ClientFactoryInterface.
9+
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
1010
*/
1111
interface ClientFactoryInterface
1212
{

ClientFactory/DummyFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Http\HttplugBundle\ClientFactory;
44

5-
use Http\Client\HttpClient;
65
use Http\HttplugBundle\Exception\ClientWasNotCreated;
76

87
/**

ClientFactory/GenericClientFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class GenericClientFactory
2525
public function getClient($name, array $config = [])
2626
{
2727
if (!isset($this->clientFactories[$name])) {
28-
throw new \InvalidArgumentException(sprintf('No configurator named %s was found.', $name));
28+
throw new \InvalidArgumentException(sprintf('No factory named %s was found. Configured factory names are: %s', $name, implode(', ', array_keys($this->clientFactories))));
2929
}
3030

3131
return $this->clientFactories[$name]->createClient($config);

DependencyInjection/Configuration.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,16 @@ public function getConfigTreeBuilder()
7878

7979
protected function configureClients(ArrayNodeDefinition $root)
8080
{
81-
$validAdapters = ['guzzle5', 'guzzle6'];
82-
8381
$root->children()
8482
->arrayNode('clients')
8583
->useAttributeAsKey('name')
8684
->prototype('array')
8785
->children()
88-
->enumNode('adapter')->values($validAdapters)->isRequired()->cannotBeEmpty()->end()
86+
->scalarNode('adapter')
87+
->isRequired()
88+
->cannotBeEmpty()
89+
->info('The name of the adapter to use. There must be a factory corresponding to this name. Example values: guzzle5, guzzle6')
90+
->end()
8991
->variableNode('config')->end()
9092
->end()
9193
->end();

0 commit comments

Comments
 (0)