Skip to content

Commit ff424ed

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent b93c436 commit ff424ed

16 files changed

+21
-21
lines changed

Definition.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class Definition
3232
* @param Transition[] $transitions
3333
* @param string|string[]|null $initialPlaces
3434
*/
35-
public function __construct(array $places, array $transitions, $initialPlaces = null, MetadataStoreInterface $metadataStore = null)
35+
public function __construct(array $places, array $transitions, $initialPlaces = null, ?MetadataStoreInterface $metadataStore = null)
3636
{
3737
foreach ($places as $place) {
3838
$this->addPlace($place);

Dumper/DumperInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ interface DumperInterface
2727
*
2828
* @return string
2929
*/
30-
public function dump(Definition $definition, Marking $marking = null, array $options = []);
30+
public function dump(Definition $definition, ?Marking $marking = null, array $options = []);
3131
}

Dumper/GraphvizDumper.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class GraphvizDumper implements DumperInterface
4444
* * node: The default options for nodes (places + transitions)
4545
* * edge: The default options for edges
4646
*/
47-
public function dump(Definition $definition, Marking $marking = null, array $options = [])
47+
public function dump(Definition $definition, ?Marking $marking = null, array $options = [])
4848
{
4949
$places = $this->findPlaces($definition, $marking);
5050
$transitions = $this->findTransitions($definition);
@@ -62,7 +62,7 @@ public function dump(Definition $definition, Marking $marking = null, array $opt
6262
/**
6363
* @internal
6464
*/
65-
protected function findPlaces(Definition $definition, Marking $marking = null): array
65+
protected function findPlaces(Definition $definition, ?Marking $marking = null): array
6666
{
6767
$workflowMetadata = $definition->getMetadataStore();
6868

Dumper/MermaidDumper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct(string $transitionType, string $direction = self::DI
6666
$this->transitionType = $transitionType;
6767
}
6868

69-
public function dump(Definition $definition, Marking $marking = null, array $options = []): string
69+
public function dump(Definition $definition, ?Marking $marking = null, array $options = []): string
7070
{
7171
$this->linkCount = 0;
7272
$placeNameMap = [];

Dumper/PlantUmlDumper.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ class PlantUmlDumper implements DumperInterface
5353

5454
private $transitionType = self::STATEMACHINE_TRANSITION;
5555

56-
public function __construct(string $transitionType = null)
56+
public function __construct(?string $transitionType = null)
5757
{
5858
if (!\in_array($transitionType, self::TRANSITION_TYPES, true)) {
5959
throw new \InvalidArgumentException("Transition type '$transitionType' does not exist.");
6060
}
6161
$this->transitionType = $transitionType;
6262
}
6363

64-
public function dump(Definition $definition, Marking $marking = null, array $options = []): string
64+
public function dump(Definition $definition, ?Marking $marking = null, array $options = []): string
6565
{
6666
$options = array_replace_recursive(self::DEFAULT_OPTIONS, $options);
6767

@@ -191,7 +191,7 @@ private function escape(string $string): string
191191
return '"'.str_replace('"', '', $string).'"';
192192
}
193193

194-
private function getState(string $place, Definition $definition, Marking $marking = null): string
194+
private function getState(string $place, Definition $definition, ?Marking $marking = null): string
195195
{
196196
$workflowMetadata = $definition->getMetadataStore();
197197

Dumper/StateMachineGraphvizDumper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class StateMachineGraphvizDumper extends GraphvizDumper
2727
* * node: The default options for nodes (places)
2828
* * edge: The default options for edges
2929
*/
30-
public function dump(Definition $definition, Marking $marking = null, array $options = [])
30+
public function dump(Definition $definition, ?Marking $marking = null, array $options = [])
3131
{
3232
$places = $this->findPlaces($definition, $marking);
3333
$edges = $this->findEdges($definition);

Event/Event.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Event extends BaseEvent
2929
private $transition;
3030
private $workflow;
3131

32-
public function __construct(object $subject, Marking $marking, Transition $transition = null, WorkflowInterface $workflow = null, array $context = [])
32+
public function __construct(object $subject, Marking $marking, ?Transition $transition = null, ?WorkflowInterface $workflow = null, array $context = [])
3333
{
3434
$this->subject = $subject;
3535
$this->marking = $marking;

Event/GuardEvent.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class GuardEvent extends Event
2828
/**
2929
* {@inheritdoc}
3030
*/
31-
public function __construct(object $subject, Marking $marking, Transition $transition, WorkflowInterface $workflow = null)
31+
public function __construct(object $subject, Marking $marking, Transition $transition, ?WorkflowInterface $workflow = null)
3232
{
3333
parent::__construct($subject, $marking, $transition, $workflow);
3434

@@ -45,7 +45,7 @@ public function isBlocked(): bool
4545
return !$this->transitionBlockerList->isEmpty();
4646
}
4747

48-
public function setBlocked(bool $blocked, string $message = null): void
48+
public function setBlocked(bool $blocked, ?string $message = null): void
4949
{
5050
if (!$blocked) {
5151
$this->transitionBlockerList->clear();

EventListener/GuardListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class GuardListener
3232
private $roleHierarchy;
3333
private $validator;
3434

35-
public function __construct(array $configuration, ExpressionLanguage $expressionLanguage, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authorizationChecker, AuthenticationTrustResolverInterface $trustResolver, RoleHierarchyInterface $roleHierarchy = null, ValidatorInterface $validator = null)
35+
public function __construct(array $configuration, ExpressionLanguage $expressionLanguage, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authorizationChecker, AuthenticationTrustResolverInterface $trustResolver, ?RoleHierarchyInterface $roleHierarchy = null, ?ValidatorInterface $validator = null)
3636
{
3737
$this->configuration = $configuration;
3838
$this->expressionLanguage = $expressionLanguage;

Metadata/InMemoryMetadataStore.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class InMemoryMetadataStore implements MetadataStoreInterface
2727
/**
2828
* @param \SplObjectStorage<Transition, array>|null $transitionsMetadata
2929
*/
30-
public function __construct(array $workflowMetadata = [], array $placesMetadata = [], \SplObjectStorage $transitionsMetadata = null)
30+
public function __construct(array $workflowMetadata = [], array $placesMetadata = [], ?\SplObjectStorage $transitionsMetadata = null)
3131
{
3232
$this->workflowMetadata = $workflowMetadata;
3333
$this->placesMetadata = $placesMetadata;

Registry.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function addWorkflow(WorkflowInterface $workflow, WorkflowSupportStrategy
2727
$this->workflows[] = [$workflow, $supportStrategy];
2828
}
2929

30-
public function has(object $subject, string $workflowName = null): bool
30+
public function has(object $subject, ?string $workflowName = null): bool
3131
{
3232
foreach ($this->workflows as [$workflow, $supportStrategy]) {
3333
if ($this->supports($workflow, $supportStrategy, $subject, $workflowName)) {
@@ -41,7 +41,7 @@ public function has(object $subject, string $workflowName = null): bool
4141
/**
4242
* @return Workflow
4343
*/
44-
public function get(object $subject, string $workflowName = null)
44+
public function get(object $subject, ?string $workflowName = null)
4545
{
4646
$matched = [];
4747

StateMachine.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class StateMachine extends Workflow
2222
{
23-
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed', array $eventsToDispatch = null)
23+
public function __construct(Definition $definition, ?MarkingStoreInterface $markingStore = null, ?EventDispatcherInterface $dispatcher = null, string $name = 'unnamed', ?array $eventsToDispatch = null)
2424
{
2525
parent::__construct($definition, $markingStore ?? new MethodMarkingStore(true), $dispatcher, $name, $eventsToDispatch);
2626
}

Tests/EventListener/GuardListenerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function testGuardExpressionBlocks()
148148
$this->assertTrue($event->isBlocked());
149149
}
150150

151-
private function createEvent(Transition $transition = null)
151+
private function createEvent(?Transition $transition = null)
152152
{
153153
$subject = new Subject();
154154
$transition = $transition ?? new Transition('name', 'from', 'to');

Tests/WorkflowTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ class EventDispatcherMock implements \Symfony\Contracts\EventDispatcher\EventDis
791791
{
792792
public $dispatchedEvents = [];
793793

794-
public function dispatch($event, string $eventName = null): object
794+
public function dispatch($event, ?string $eventName = null): object
795795
{
796796
$this->dispatchedEvents[] = $eventName;
797797

TransitionBlocker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static function createBlockedByExpressionGuardListener(string $expression
6767
* Creates a blocker that says the transition cannot be made because of an
6868
* unknown reason.
6969
*/
70-
public static function createUnknown(string $message = null, int $backtraceFrame = 2): self
70+
public static function createUnknown(?string $message = null, int $backtraceFrame = 2): self
7171
{
7272
if (null !== $message) {
7373
return new static($message, self::UNKNOWN);

Workflow.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Workflow implements WorkflowInterface
6767
*/
6868
private $eventsToDispatch = null;
6969

70-
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed', array $eventsToDispatch = null)
70+
public function __construct(Definition $definition, ?MarkingStoreInterface $markingStore = null, ?EventDispatcherInterface $dispatcher = null, string $name = 'unnamed', ?array $eventsToDispatch = null)
7171
{
7272
$this->definition = $definition;
7373
$this->markingStore = $markingStore ?? new MethodMarkingStore();

0 commit comments

Comments
 (0)