-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Workfow] Rename current MarkingStore #20462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,11 @@ | |
use Symfony\Component\Workflow\Marking; | ||
|
||
/** | ||
* MarkingStoreInterface. | ||
* MarkingStoreInterface is the interface between the Workflow Component and a | ||
* plain old PHP object: the subject. | ||
* | ||
* It converts the Marking into something understandable by the subject and vice | ||
* versa. | ||
* | ||
* @author Grégoire Pineau <[email protected]> | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,17 +16,21 @@ | |
use Symfony\Component\Workflow\Marking; | ||
|
||
/** | ||
* PropertyAccessorMarkingStore. | ||
* MultipleStateMarkingStore stores the marking into a property of the | ||
* subject. | ||
* | ||
* This store deals with a "multiple state" Marking. It means a subject can be | ||
* in many state at the same time. | ||
* | ||
* @author Grégoire Pineau <[email protected]> | ||
*/ | ||
class PropertyAccessorMarkingStore implements MarkingStoreInterface | ||
class MultipleStateMarkingStore implements MarkingStoreInterface | ||
{ | ||
private $property; | ||
private $propertyAccessor; | ||
|
||
/** | ||
* PropertyAccessorMarkingStore constructor. | ||
* MultipleStateMarkingStore constructor. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't add any value. |
||
* | ||
* @param string $property | ||
* @param PropertyAccessorInterface|null $propertyAccessor | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,17 +16,20 @@ | |
use Symfony\Component\Workflow\Marking; | ||
|
||
/** | ||
* ScalarMarkingStore. | ||
* SingleStateMarkingStore stores the marking into a property of the subject. | ||
* | ||
* This store deals with a "single state" Marking. It means a subject can be in | ||
* one and only state at the same time. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [...] and only one state [...] |
||
* | ||
* @author Grégoire Pineau <[email protected]> | ||
*/ | ||
class ScalarMarkingStore implements MarkingStoreInterface | ||
class SingleStateMarkingStore implements MarkingStoreInterface | ||
{ | ||
private $property; | ||
private $propertyAccessor; | ||
|
||
/** | ||
* ScalarMarkingStore constructor. | ||
* SingleStateMarkingStore constructor. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
* | ||
* @param string $property | ||
* @param PropertyAccessorInterface|null $propertyAccessor | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface; | ||
use Symfony\Component\Workflow\MarkingStore\ScalarMarkingStore; | ||
use Symfony\Component\Workflow\MarkingStore\SingleStateMarkingStore; | ||
|
||
/** | ||
* @author Tobias Nyholm <[email protected]> | ||
|
@@ -13,6 +13,6 @@ class StateMachine extends Workflow | |
{ | ||
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, $name = 'unnamed') | ||
{ | ||
parent::__construct($definition, $markingStore ?: new ScalarMarkingStore(), $dispatcher, $name); | ||
parent::__construct($definition, $markingStore ?: new SingleStateMarkingStore(), $dispatcher, $name); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
use Symfony\Component\Workflow\Event\GuardEvent; | ||
use Symfony\Component\Workflow\Exception\LogicException; | ||
use Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface; | ||
use Symfony\Component\Workflow\MarkingStore\PropertyAccessorMarkingStore; | ||
use Symfony\Component\Workflow\MarkingStore\MultipleStateMarkingStore; | ||
|
||
/** | ||
* @author Fabien Potencier <[email protected]> | ||
|
@@ -33,7 +33,7 @@ class Workflow | |
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, $name = 'unnamed') | ||
{ | ||
$this->definition = $definition; | ||
$this->markingStore = $markingStore ?: new PropertyAccessorMarkingStore(); | ||
$this->markingStore = $markingStore ?: new MultipleStateMarkingStore(); | ||
$this->dispatcher = $dispatcher; | ||
$this->name = $name; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
states