Skip to content

Commit

Permalink
Merge pull request #7 from travello-gmbh/6-new-skillconfig-injection
Browse files Browse the repository at this point in the history
Implemented new SkillConfiguration class injection
  • Loading branch information
Ralf Eggert committed Nov 26, 2017
2 parents 09a914e + 4f8693b commit 940ffe6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
43 changes: 22 additions & 21 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/Application/AlexaApplicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ public function __invoke(
$alexaRequest = $container->get(AlexaRequest::class);
$alexaResponse = $container->get(AlexaResponse::class);
$intentManager = $container->get(IntentManager::class);
$skillConfiguration = $container->get(SkillConfiguration::class);

/** @var AlexaApplication $alexaApplication */
$alexaApplication = new $requestedName(
$alexaRequest, $alexaResponse, $intentManager, $skillConfiguration
$alexaRequest, $alexaResponse, $intentManager
);

return $alexaApplication;
Expand Down
5 changes: 3 additions & 2 deletions src/Intent/AbstractIntentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Interop\Container\ContainerInterface;
use TravelloAlexaLibrary\Configuration\SkillConfiguration;
use TravelloAlexaLibrary\Intent\AbstractIntent;
use TravelloAlexaLibrary\Intent\IntentInterface;
use TravelloAlexaLibrary\Request\AlexaRequest;
use TravelloAlexaLibrary\Response\AlexaResponse;
Expand Down Expand Up @@ -47,8 +48,8 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
/** @var TextHelper $textHelper */
$textHelper = $container->get($skillConfiguration->getTextHelperClass());

/** @var IntentInterface $intent */
$intent = new $requestedName($alexaRequest, $alexaResponse, $textHelper);
/** @var AbstractIntent $intent */
$intent = new $requestedName($alexaRequest, $alexaResponse, $textHelper, $skillConfiguration);

return $intent;
}
Expand Down

0 comments on commit 940ffe6

Please sign in to comment.