Skip to content

Commit 33ea649

Browse files
Replace more docblocks by type-hints
1 parent 5ac6862 commit 33ea649

File tree

9 files changed

+9
-20
lines changed

9 files changed

+9
-20
lines changed

DependencyInjection/ValidateWorkflowsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ValidateWorkflowsPass implements CompilerPassInterface
2424
{
2525
private $definitionTag;
2626

27-
public function __construct($definitionTag = 'workflow.definition')
27+
public function __construct(string $definitionTag = 'workflow.definition')
2828
{
2929
$this->definitionTag = $definitionTag;
3030
}

Event/Event.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Event extends BaseEvent
3232
* @param Transition $transition
3333
* @param string $workflowName
3434
*/
35-
public function __construct($subject, Marking $marking, Transition $transition, $workflowName = 'unnamed')
35+
public function __construct($subject, Marking $marking, Transition $transition, string $workflowName = 'unnamed')
3636
{
3737
$this->subject = $subject;
3838
$this->marking = $marking;

EventListener/GuardListener.php

Lines changed: 1 addition & 1 deletion
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($configuration, ExpressionLanguage $expressionLanguage, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authenticationChecker, AuthenticationTrustResolverInterface $trustResolver, RoleHierarchyInterface $roleHierarchy = null, ValidatorInterface $validator = null)
35+
public function __construct(array $configuration, ExpressionLanguage $expressionLanguage, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authenticationChecker, AuthenticationTrustResolverInterface $trustResolver, RoleHierarchyInterface $roleHierarchy = null, ValidatorInterface $validator = null)
3636
{
3737
$this->configuration = $configuration;
3838
$this->expressionLanguage = $expressionLanguage;

MarkingStore/MultipleStateMarkingStore.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ class MultipleStateMarkingStore implements MarkingStoreInterface
2929
private $property;
3030
private $propertyAccessor;
3131

32-
/**
33-
* @param string $property
34-
* @param PropertyAccessorInterface|null $propertyAccessor
35-
*/
36-
public function __construct($property = 'marking', PropertyAccessorInterface $propertyAccessor = null)
32+
public function __construct(string $property = 'marking', PropertyAccessorInterface $propertyAccessor = null)
3733
{
3834
$this->property = $property;
3935
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();

MarkingStore/SingleStateMarkingStore.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ class SingleStateMarkingStore implements MarkingStoreInterface
2828
private $property;
2929
private $propertyAccessor;
3030

31-
/**
32-
* @param string $property
33-
* @param PropertyAccessorInterface|null $propertyAccessor
34-
*/
35-
public function __construct($property = 'marking', PropertyAccessorInterface $propertyAccessor = null)
31+
public function __construct(string $property = 'marking', PropertyAccessorInterface $propertyAccessor = null)
3632
{
3733
$this->property = $property;
3834
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();

StateMachine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class StateMachine extends Workflow
1313
{
14-
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, $name = 'unnamed')
14+
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed')
1515
{
1616
parent::__construct($definition, $markingStore ?: new SingleStateMarkingStore(), $dispatcher, $name);
1717
}

Transition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Transition
2828
* @param string|string[] $froms
2929
* @param string|string[] $tos
3030
*/
31-
public function __construct($name, $froms, $tos)
31+
public function __construct(string $name, $froms, $tos)
3232
{
3333
if (!preg_match('{^[\w\d_-]+$}', $name)) {
3434
throw new InvalidArgumentException(sprintf('The transition "%s" contains invalid characters.', $name));

Validator/WorkflowValidator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ class WorkflowValidator implements DefinitionValidatorInterface
2121
{
2222
private $singlePlace;
2323

24-
/**
25-
* @param bool $singlePlace
26-
*/
27-
public function __construct($singlePlace = false)
24+
public function __construct(bool $singlePlace = false)
2825
{
2926
$this->singlePlace = $singlePlace;
3027
}

Workflow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Workflow
3030
private $dispatcher;
3131
private $name;
3232

33-
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, $name = 'unnamed')
33+
public function __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed')
3434
{
3535
$this->definition = $definition;
3636
$this->markingStore = $markingStore ?: new MultipleStateMarkingStore();

0 commit comments

Comments
 (0)