Skip to content

Commit b59185a

Browse files
committed
Merge branch '3.4' into 4.1
* 3.4: 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 293165f + 4b25bea commit b59185a

23 files changed

+96
-96
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/GraphvizDumper.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
*/
2727
class GraphvizDumper implements DumperInterface
2828
{
29-
protected static $defaultOptions = array(
30-
'graph' => array('ratio' => 'compress', 'rankdir' => 'LR'),
31-
'node' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => '#333333', 'fillcolor' => 'lightblue', 'fixedsize' => true, 'width' => 1),
32-
'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => '#333333', 'arrowhead' => 'normal', 'arrowsize' => 0.5),
33-
);
29+
protected static $defaultOptions = [
30+
'graph' => ['ratio' => 'compress', 'rankdir' => 'LR'],
31+
'node' => ['fontsize' => 9, 'fontname' => 'Arial', 'color' => '#333333', 'fillcolor' => 'lightblue', 'fixedsize' => true, 'width' => 1],
32+
'edge' => ['fontsize' => 9, 'fontname' => 'Arial', 'color' => '#333333', 'arrowhead' => 'normal', 'arrowsize' => 0.5],
33+
];
3434

3535
/**
3636
* {@inheritdoc}
@@ -43,7 +43,7 @@ class GraphvizDumper implements DumperInterface
4343
* * node: The default options for nodes (places + transitions)
4444
* * edge: The default options for edges
4545
*/
46-
public function dump(Definition $definition, Marking $marking = null, array $options = array())
46+
public function dump(Definition $definition, Marking $marking = null, array $options = [])
4747
{
4848
$places = $this->findPlaces($definition, $marking);
4949
$transitions = $this->findTransitions($definition);
@@ -63,20 +63,20 @@ public function dump(Definition $definition, Marking $marking = null, array $opt
6363
*/
6464
protected function findPlaces(Definition $definition, Marking $marking = null)
6565
{
66-
$places = array();
66+
$places = [];
6767

6868
foreach ($definition->getPlaces() as $place) {
69-
$attributes = array();
69+
$attributes = [];
7070
if ($place === $definition->getInitialPlace()) {
7171
$attributes['style'] = 'filled';
7272
}
7373
if ($marking && $marking->has($place)) {
7474
$attributes['color'] = '#FF0000';
7575
$attributes['shape'] = 'doublecircle';
7676
}
77-
$places[$place] = array(
77+
$places[$place] = [
7878
'attributes' => $attributes,
79-
);
79+
];
8080
}
8181

8282
return $places;
@@ -87,13 +87,13 @@ protected function findPlaces(Definition $definition, Marking $marking = null)
8787
*/
8888
protected function findTransitions(Definition $definition)
8989
{
90-
$transitions = array();
90+
$transitions = [];
9191

9292
foreach ($definition->getTransitions() as $transition) {
93-
$transitions[] = array(
94-
'attributes' => array('shape' => 'box', 'regular' => true),
93+
$transitions[] = [
94+
'attributes' => ['shape' => 'box', 'regular' => true],
9595
'name' => $transition->getName(),
96-
);
96+
];
9797
}
9898

9999
return $transitions;
@@ -132,22 +132,22 @@ protected function addTransitions(array $transitions)
132132
*/
133133
protected function findEdges(Definition $definition)
134134
{
135-
$dotEdges = array();
135+
$dotEdges = [];
136136

137137
foreach ($definition->getTransitions() as $transition) {
138138
foreach ($transition->getFroms() as $from) {
139-
$dotEdges[] = array(
139+
$dotEdges[] = [
140140
'from' => $from,
141141
'to' => $transition->getName(),
142142
'direction' => 'from',
143-
);
143+
];
144144
}
145145
foreach ($transition->getTos() as $to) {
146-
$dotEdges[] = array(
146+
$dotEdges[] = [
147147
'from' => $transition->getName(),
148148
'to' => $to,
149149
'direction' => 'to',
150-
);
150+
];
151151
}
152152
}
153153

@@ -211,7 +211,7 @@ protected function escape(string $string): string
211211

212212
private function addAttributes(array $attributes): string
213213
{
214-
$code = array();
214+
$code = [];
215215

216216
foreach ($attributes as $k => $v) {
217217
$code[] = sprintf('%s="%s"', $k, $this->escape($v));
@@ -222,7 +222,7 @@ private function addAttributes(array $attributes): string
222222

223223
private function addOptions(array $options): string
224224
{
225-
$code = array();
225+
$code = [];
226226

227227
foreach ($options as $k => $v) {
228228
$code[] = sprintf('%s="%s"', $k, $v);

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)