Skip to content

Commit 238c0aa

Browse files
committed
[CS] Replace easy occurences of ?: with ??
1 parent 97bfe13 commit 238c0aa

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Definition.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(array $places, array $transitions, $initialPlaces =
4444

4545
$this->setInitialPlaces($initialPlaces);
4646

47-
$this->metadataStore = $metadataStore ?: new InMemoryMetadataStore();
47+
$this->metadataStore = $metadataStore ?? new InMemoryMetadataStore();
4848
}
4949

5050
/**

Metadata/InMemoryMetadataStore.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(array $workflowMetadata = [], array $placesMetadata
2828
{
2929
$this->workflowMetadata = $workflowMetadata;
3030
$this->placesMetadata = $placesMetadata;
31-
$this->transitionsMetadata = $transitionsMetadata ?: new \SplObjectStorage();
31+
$this->transitionsMetadata = $transitionsMetadata ?? new \SplObjectStorage();
3232
}
3333

3434
public function getWorkflowMetadata(): array

StateMachine.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ class StateMachine extends Workflow
2222
{
2323
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed')
2424
{
25-
parent::__construct($definition, $markingStore ?: new MethodMarkingStore(true, 'marking'), $dispatcher, $name);
25+
parent::__construct($definition, $markingStore ?? new MethodMarkingStore(true, 'marking'), $dispatcher, $name);
2626
}
2727
}

Tests/EventListener/GuardListenerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function testGuardExpressionBlocks()
136136
private function createEvent(Transition $transition = null)
137137
{
138138
$subject = new Subject();
139-
$transition = $transition ?: new Transition('name', 'from', 'to');
139+
$transition = $transition ?? new Transition('name', 'from', 'to');
140140

141141
$workflow = $this->createMock(WorkflowInterface::class);
142142

Workflow.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Workflow implements WorkflowInterface
4242
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed')
4343
{
4444
$this->definition = $definition;
45-
$this->markingStore = $markingStore ?: new MultipleStateMarkingStore();
45+
$this->markingStore = $markingStore ?? new MultipleStateMarkingStore();
4646

4747
if (null !== $dispatcher && class_exists(LegacyEventDispatcherProxy::class)) {
4848
$this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);

0 commit comments

Comments
 (0)