Skip to content

Commit

Permalink
Nette 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
vody105 committed Aug 24, 2019
1 parent 25af41f commit f3d31c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"php": ">= 7.2",
"ext-json": "*",
"guzzlehttp/psr7": "^1.4",
"nette/utils": "~2.4 || ~3.0"
"nette/utils": "~3.0.0"
},
"require-dev": {
"nette/di": "~2.4",
"contributte/guzzlette": "~2.1",
"nette/http": "~2.4.10",
"nette/di": "~3.0.0",
"contributte/guzzlette": "~3.0.0",
"nette/caching": "~3.0.0",
"ninjify/qa": "^0.8.0",
"ninjify/nunjuck": "^0.2.0",
"mockery/mockery": "^1.1.0",
Expand Down Expand Up @@ -52,7 +52,7 @@
},
"suggest": {
"contributte/guzzlette": "As default HttpClient",
"nette/http": "As session handler in AccessTokenSessionProvider"
"nette/caching": "As cache handler in AccessTokenCacheProvider"
},
"extra": {
"branch-alias": {
Expand Down
12 changes: 5 additions & 7 deletions src/DI/GoSmsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ public function loadConfiguration(): void
$config['clientSecret'],
]);

// HttpClient
$hc = $builder->addDefinition($this->prefix('httpClient'));
Compiler::loadDefinition($hc, $config['httpClient']);

// AccessTokenProvider
$atp = $builder->addDefinition($this->prefix('accessTokenProvider'));
Compiler::loadDefinition($atp, $config['accessTokenProvider']);
// HttpClient, AccessTokenProvider
$this->compiler->loadDefinitionsFromConfig([
$this->prefix('httpClient') => $config['httpClient'],
$this->prefix('accessTokenProvider') => $config['accessTokenProvider'],
]);

// Message Client
$builder->addDefinition($this->prefix('message'))
Expand Down

0 comments on commit f3d31c3

Please sign in to comment.