Skip to content

Commit a19f39b

Browse files
committed
Merge branch '4.1' into 4.2
* 4.1: fixed tests fixed CS fixed CS fixed CS fixed short array CS in comments fixed CS in ExpressionLanguage fixtures fixed CS in generated files fixed CS on generated container files fixed CS on Form PHP templates fixed CS on YAML fixtures fixed fixtures switched array() to []
2 parents b2e7ce6 + d1d4e07 commit a19f39b

34 files changed

+176
-176
lines changed

Definition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
*/
2323
final class Definition
2424
{
25-
private $places = array();
26-
private $transitions = array();
25+
private $places = [];
26+
private $transitions = [];
2727
private $initialPlace;
2828
private $metadataStore;
2929

DefinitionBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
*/
2323
class DefinitionBuilder
2424
{
25-
private $places = array();
26-
private $transitions = array();
25+
private $places = [];
26+
private $transitions = [];
2727
private $initialPlace;
2828
private $metadataStore;
2929

3030
/**
3131
* @param string[] $places
3232
* @param Transition[] $transitions
3333
*/
34-
public function __construct(array $places = array(), array $transitions = array())
34+
public function __construct(array $places = [], array $transitions = [])
3535
{
3636
$this->addPlaces($places);
3737
$this->addTransitions($transitions);
@@ -52,8 +52,8 @@ public function build()
5252
*/
5353
public function clear()
5454
{
55-
$this->places = array();
56-
$this->transitions = array();
55+
$this->places = [];
56+
$this->transitions = [];
5757
$this->initialPlace = null;
5858
$this->metadataStore = null;
5959

Dumper/DumperInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ interface DumperInterface
3131
*
3232
* @return string The representation of the workflow
3333
*/
34-
public function dump(Definition $definition, Marking $marking = null, array $options = array());
34+
public function dump(Definition $definition, Marking $marking = null, array $options = []);
3535
}

Dumper/PlantUmlDumper.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ class PlantUmlDumper implements DumperInterface
3131

3232
const STATEMACHINE_TRANSITION = 'arrow';
3333
const WORKFLOW_TRANSITION = 'square';
34-
const TRANSITION_TYPES = array(self::STATEMACHINE_TRANSITION, self::WORKFLOW_TRANSITION);
35-
const DEFAULT_OPTIONS = array(
36-
'skinparams' => array(
34+
const TRANSITION_TYPES = [self::STATEMACHINE_TRANSITION, self::WORKFLOW_TRANSITION];
35+
const DEFAULT_OPTIONS = [
36+
'skinparams' => [
3737
'titleBorderRoundCorner' => 15,
3838
'titleBorderThickness' => 2,
39-
'state' => array(
39+
'state' => [
4040
'BackgroundColor'.self::INITIAL => '#87b741',
4141
'BackgroundColor'.self::MARKED => '#3887C6',
4242
'BorderColor' => '#3887C6',
4343
'BorderColor'.self::MARKED => 'Black',
4444
'FontColor'.self::MARKED => 'White',
45-
),
46-
'agent' => array(
45+
],
46+
'agent' => [
4747
'BackgroundColor' => '#ffffff',
4848
'BorderColor' => '#3887C6',
49-
),
50-
),
51-
);
49+
],
50+
],
51+
];
5252

5353
private $transitionType = self::STATEMACHINE_TRANSITION;
5454

@@ -60,7 +60,7 @@ public function __construct(string $transitionType = null)
6060
$this->transitionType = $transitionType;
6161
}
6262

63-
public function dump(Definition $definition, Marking $marking = null, array $options = array()): string
63+
public function dump(Definition $definition, Marking $marking = null, array $options = []): string
6464
{
6565
$options = array_replace_recursive(self::DEFAULT_OPTIONS, $options);
6666
$code = $this->initialize($options);
@@ -84,10 +84,10 @@ public function dump(Definition $definition, Marking $marking = null, array $opt
8484
foreach ($transition->getTos() as $to) {
8585
$toEscaped = $this->escape($to);
8686
if ($this->isWorkflowTransitionType()) {
87-
$lines = array(
87+
$lines = [
8888
"$fromEscaped --> $transitionEscaped",
8989
"$transitionEscaped --> $toEscaped",
90-
);
90+
];
9191
foreach ($lines as $line) {
9292
if (!\in_array($line, $code)) {
9393
$code[] = $line;
@@ -128,7 +128,7 @@ private function getLines(array $code): string
128128

129129
private function initialize(array $options): array
130130
{
131-
$code = array();
131+
$code = [];
132132
if (isset($options['title'])) {
133133
$code[] = "title {$options['title']}";
134134
}

Dumper/StateMachineGraphvizDumper.php

Lines changed: 4 additions & 4 deletions
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 = array())
30+
public function dump(Definition $definition, Marking $marking = null, array $options = [])
3131
{
3232
$places = $this->findPlaces($definition, $marking);
3333
$edges = $this->findEdges($definition);
@@ -46,15 +46,15 @@ public function dump(Definition $definition, Marking $marking = null, array $opt
4646
*/
4747
protected function findEdges(Definition $definition)
4848
{
49-
$edges = array();
49+
$edges = [];
5050

5151
foreach ($definition->getTransitions() as $transition) {
5252
foreach ($transition->getFroms() as $from) {
5353
foreach ($transition->getTos() as $to) {
54-
$edges[$from][] = array(
54+
$edges[$from][] = [
5555
'name' => $transition->getName(),
5656
'to' => $to,
57-
);
57+
];
5858
}
5959
}
6060
}

EventListener/AuditTrailListener.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ public function onEnter(Event $event)
4848

4949
public static function getSubscribedEvents()
5050
{
51-
return array(
52-
'workflow.leave' => array('onLeave'),
53-
'workflow.transition' => array('onTransition'),
54-
'workflow.enter' => array('onEnter'),
55-
);
51+
return [
52+
'workflow.leave' => ['onLeave'],
53+
'workflow.transition' => ['onTransition'],
54+
'workflow.enter' => ['onEnter'],
55+
];
5656
}
5757
}

EventListener/GuardListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private function getVariables(GuardEvent $event): array
8686
$roles = $token->getRoles();
8787
}
8888

89-
$variables = array(
89+
$variables = [
9090
'token' => $token,
9191
'user' => $token->getUser(),
9292
'subject' => $event->getSubject(),
@@ -99,7 +99,7 @@ private function getVariables(GuardEvent $event): array
9999
'trust_resolver' => $this->trustResolver,
100100
// needed for the is_valid expression function
101101
'validator' => $this->validator,
102-
);
102+
];
103103

104104
return $variables;
105105
}

Marking.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919
class Marking
2020
{
21-
private $places = array();
21+
private $places = [];
2222

2323
/**
2424
* @param int[] $representation Keys are the place name and values should be 1
2525
*/
26-
public function __construct(array $representation = array())
26+
public function __construct(array $representation = [])
2727
{
2828
foreach ($representation as $place => $nbToken) {
2929
$this->mark($place);

MarkingStore/MultipleStateMarkingStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(string $property = 'marking', PropertyAccessorInterf
4040
*/
4141
public function getMarking($subject)
4242
{
43-
return new Marking($this->propertyAccessor->getValue($subject, $this->property) ?: array());
43+
return new Marking($this->propertyAccessor->getValue($subject, $this->property) ?: []);
4444
}
4545

4646
/**

MarkingStore/SingleStateMarkingStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getMarking($subject)
4545
return new Marking();
4646
}
4747

48-
return new Marking(array($placeName => 1));
48+
return new Marking([$placeName => 1]);
4949
}
5050

5151
/**

0 commit comments

Comments
 (0)