Skip to content

Commit

Permalink
Added php-http/httplug-bundle as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Mar 5, 2016
1 parent 1091c08 commit 5de380c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public function getConfigTreeBuilder()
$root = $treeBuilder->root('happyr_linkedin');

$root->children()
->scalarNode('http_client')->info('A service id for a Httplug adapter')->end()
->scalarNode('http_client')->defaultValue('httplug.client')->info('A service id for a Httplug adapter')->end()
->scalarNode('http_message_factory')->defaultValue('httplug.message_factory')->info('A service id for a Httplug adapter')->end()
->scalarNode('app_id')->isRequired()->end()
->scalarNode('app_secret')->isRequired()->end()
->scalarNode('request_format')->cannotBeEmpty()->defaultValue('json')->end()
Expand Down
5 changes: 5 additions & 0 deletions DependencyInjection/HappyrLinkedInExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public function load(array $configs, ContainerBuilder $container)
$def = $container->getDefinition('happyr.linkedin');
$def->addMethodCall('setHttpClient', [new Reference($config['http_client'])]);
}

if (!empty($config['http_message_factory'])) {
$def = $container->getDefinition('happyr.linkedin');
$def->addMethodCall('setHttpMessageFactory', [new Reference($config['http_message_factory'])]);
}
}

public function getAlias()
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ happyr_linkedin:
request_format: 'json' # Default
response_format: 'array' # Default
http_client: 'httplug.client' # Service ID for an object implementing Http\Client\HttpClient
http_message_factory: 'httplug.message_factory' # Service ID for an object implementing Http\Message\MessageFactory
```
```php
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
}
],
"require": {
"php": ">=5.5",
"php": "^5.5|^7.0",
"symfony/symfony":"^2.3|^3.0",
"happyr/linkedin-api-client": "^0.7"
"happyr/linkedin-api-client": "^0.7",
"php-http/httplug-bundle": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 5de380c

Please sign in to comment.