Skip to content

Commit 7e3fd08

Browse files
[PageflowerBundle] SecureRandomInterfaceへの参照を削除した。
1 parent 485acd5 commit 7e3fd08

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=5.3.9",
14+
"php": ">=7.0",
1515
"doctrine/annotations": "~1.0",
1616
"phpmentors/domain-kata": "~1.0",
1717
"piece/stagehand-fsm": "~2.6",
@@ -23,7 +23,6 @@
2323
"symfony/http-foundation": "~4.0|~5.0",
2424
"symfony/http-kernel": "~4.0|~5.0",
2525
"symfony/routing": "~4.0|~5.0",
26-
"symfony/security": "~4.0|~5.0",
2726
"symfony/validator": "~4.0|~5.0"
2827
},
2928
"require-dev": {

src/EventListener/ConversationListener.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,13 @@ class ConversationListener implements ConversationContextAwareInterface
6464
* @param ConversationRepository $conversationRepository
6565
* @param PageflowRepository $pageflowRepository
6666
* @param ReflectionConversationalControllerRepository $reflectionConversationalControllerRepository
67-
* @param SecureRandomInterface $secureRandom
6867
* @param EndableConversationSpecification $endableConversationSpecification
6968
*/
70-
public function __construct(ConversationRepository $conversationRepository, PageflowRepository $pageflowRepository, ReflectionConversationalControllerRepository $reflectionConversationalControllerRepository, SecureRandomInterface $secureRandom = null, EndableConversationSpecification $endableConversationSpecification)
69+
public function __construct(ConversationRepository $conversationRepository, PageflowRepository $pageflowRepository, ReflectionConversationalControllerRepository $reflectionConversationalControllerRepository, EndableConversationSpecification $endableConversationSpecification)
7170
{
7271
$this->conversationRepository = $conversationRepository;
7372
$this->pageflowRepository = $pageflowRepository;
7473
$this->reflectionConversationalControllerRepository = $reflectionConversationalControllerRepository;
75-
$this->secureRandom = $secureRandom;
7674
$this->endableConversationSpecification = $endableConversationSpecification;
7775
}
7876

@@ -254,6 +252,6 @@ private function createPageflow(Pageflow $pageflow)
254252
*/
255253
private function generateConversationId()
256254
{
257-
return sha1($this->secureRandom === null ? random_bytes(24) : $this->secureRandom->nextBytes(24));
255+
return sha1(random_bytes(24));
258256
}
259257
}

src/Resources/config/services.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<argument type="service" id="phpmentors_pageflower.conversation_repository"/>
3333
<argument type="service" id="phpmentors_pageflower.pageflow_repository"/>
3434
<argument type="service" id="phpmentors_pageflower.reflection_conversational_controller_repository"/>
35-
<argument type="service" id="security.secure_random" on-invalid="ignore"/>
3635
<argument type="service" id="phpmentors_pageflower.endable_conversation_specification"/>
3736
<call method="setConversationContext">
3837
<argument type="service" id="phpmentors_pageflower.conversation_context"/>

0 commit comments

Comments
 (0)