Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit870856b

Browse files
committed
rename-method-fireEvent
1 parent756e491 commit870856b

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

‎src/Impl/StateMachineImpl.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function verify(string $sourceStateId, $event): bool
3232
return$transitions !=null &&count($transitions) !=0;
3333
}
3434

35-
publicfunctionfireEvent(string$sourceStateId,$event,$ctx):string
35+
publicfunctionfire(string$sourceStateId,$event,$ctx):string
3636
{
3737
$this->isReady();
3838
$transition =$this->routeTransition($sourceStateId,$event,$ctx);

‎src/StateMachineInterface.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface StateMachineInterface extends VisitableInterface
88
{
99
publicfunctionverify(string$sourceStateId,$event):bool;
1010

11-
publicfunctionfireEvent(string$sourceStateId,$event,$context):string;
11+
publicfunctionfire(string$sourceStateId,$event,$context):string;
1212

1313
publicfunctiongetMachineId():string;
1414

‎tests/StateMachineChoiceTest.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ public function testChoice(): void
6666

6767
$stateMachine =$builder->build("ChoiceConditionMachine");
6868

69-
$target1 =$stateMachine->fireEvent(
69+
$target1 =$stateMachine->fire(
7070
StateMachineTest::STATE1,
7171
StateMachineTest::EVENT1,
7272
$this->getContext("1")
7373
);
7474
$this->assertEquals(StateMachineTest::STATE1,$target1);
7575

76-
$target2 =$stateMachine->fireEvent(
76+
$target2 =$stateMachine->fire(
7777
StateMachineTest::STATE1,
7878
StateMachineTest::EVENT1,
7979
$this->getContext("2")
8080
);
8181
$this->assertEquals(StateMachineTest::STATE2,$target2);
8282

83-
$target3 =$stateMachine->fireEvent(
83+
$target3 =$stateMachine->fire(
8484
StateMachineTest::STATE1,
8585
StateMachineTest::EVENT1,
8686
$this->getContext("3")

‎tests/StateMachineTest.php‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testExternalNormal(): void
3838
->perform($this->doAction());
3939
$stateMachine =$builder->build(self::MACHINE_ID);
4040

41-
$target =$stateMachine->fireEvent(self::STATE1,self::EVENT1,$this->context);
41+
$target =$stateMachine->fire(self::STATE1,self::EVENT1,$this->context);
4242
$this->assertEquals(self::STATE2,$target);
4343
}
4444

@@ -68,7 +68,7 @@ public function testExternalTransitionsNormal(): void
6868
->perform($this->doAction());
6969
$stateMachine =$builder->build(self::MACHINE_ID ."1");
7070

71-
$target =$stateMachine->fireEvent(self::STATE2,self::EVENT1,$this->context);
71+
$target =$stateMachine->fire(self::STATE2,self::EVENT1,$this->context);
7272
$this->assertEquals(self::STATE4,$target);
7373
}
7474

@@ -82,8 +82,8 @@ public function testInternalNormal(): void
8282
->perform($this->doAction());
8383
$stateMachine =$builder->build(self::MACHINE_ID ."2");
8484

85-
$stateMachine->fireEvent(self::STATE1,self::EVENT1,$this->context);
86-
$target =$stateMachine->fireEvent(self::STATE1,self::INTERNAL_EVENT,$this->context);
85+
$stateMachine->fire(self::STATE1,self::EVENT1,$this->context);
86+
$target =$stateMachine->fire(self::STATE1,self::INTERNAL_EVENT,$this->context);
8787
$this->assertEquals(self::STATE1,$target);
8888
}
8989

@@ -92,16 +92,16 @@ public function testExternalInternalNormal(): void
9292
$stateMachine =$this->buildStateMachine("testExternalInternalNormal");
9393

9494
$context =$this->context;
95-
$target =$stateMachine->fireEvent(self::STATE1,self::EVENT1,$context);
95+
$target =$stateMachine->fire(self::STATE1,self::EVENT1,$context);
9696
$this->assertEquals(self::STATE2,$target);
9797

98-
$target =$stateMachine->fireEvent(self::STATE2,self::INTERNAL_EVENT,$context);
98+
$target =$stateMachine->fire(self::STATE2,self::INTERNAL_EVENT,$context);
9999
$this->assertEquals(self::STATE2,$target);
100-
101-
$target =$stateMachine->fireEvent(self::STATE2,self::EVENT2,$context);
100+
101+
$target =$stateMachine->fire(self::STATE2,self::EVENT2,$context);
102102
$this->assertEquals(self::STATE1,$target);
103103

104-
$target =$stateMachine->fireEvent(self::STATE1,self::EVENT3,$context);
104+
$target =$stateMachine->fire(self::STATE1,self::EVENT3,$context);
105105
$this->assertEquals(self::STATE3,$target);
106106
}
107107

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp