Skip to content

Commit 5b645c7

Browse files
authored
Merge pull request #96 from soap/develop
make Eloquent::getMarking compatible with Symfony MethodMarkingStore
2 parents a090ec7 + 9a47962 commit 5b645c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/MarkingStores/EloquentMarkingStore.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace ZeroDaHero\LaravelWorkflow\MarkingStores;
44

5+
use Symfony\Component\Translation\Exception\LogicException;
56
use Symfony\Component\Workflow\Marking;
67
use Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface;
78

@@ -39,6 +40,8 @@ public function getMarking(object $subject): Marking
3940

4041
if ($this->singleState) {
4142
$marking = [(string) $marking => 1];
43+
} else if (!\is_array($marking)) {
44+
throw new LogicException(sprintf('The marking stored in "%s::$%s" is not an array and the Workflow\'s Marking store is instantiated with $singleState=false.', get_debug_type($subject), $this->property));
4245
}
4346

4447
return new Marking($marking);

0 commit comments

Comments
 (0)