Skip to content

Commit bc40a70

Browse files
Merge branch '4.1'
* 4.1: Fix Clidumper tests Enable the fixer enforcing fully-qualified calls for compiler-optimized functions Apply fixers Disable the native_constant_invocation fixer until it can be scoped Update the list of excluded files for the CS fixer
2 parents 1a0f987 + 3c8fb49 commit bc40a70

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

Definition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private function setInitialPlace(string $place = null)
9090

9191
private function addPlace(string $place)
9292
{
93-
if (!count($this->places)) {
93+
if (!\count($this->places)) {
9494
$this->initialPlace = $place;
9595
}
9696

Dumper/PlantUmlDumper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function dump(Definition $definition, Marking $marking = null, array $opt
8989
"$transitionEscaped --> $toEscaped",
9090
);
9191
foreach ($lines as $line) {
92-
if (!in_array($line, $code)) {
92+
if (!\in_array($line, $code)) {
9393
$code[] = $line;
9494
}
9595
}
@@ -135,12 +135,12 @@ private function initialize(array $options): array
135135
if (isset($options['name'])) {
136136
$code[] = "title {$options['name']}";
137137
}
138-
if (isset($options['skinparams']) && is_array($options['skinparams'])) {
138+
if (isset($options['skinparams']) && \is_array($options['skinparams'])) {
139139
foreach ($options['skinparams'] as $skinparamKey => $skinparamValue) {
140140
if (!$this->isWorkflowTransitionType() && 'agent' === $skinparamKey) {
141141
continue;
142142
}
143-
if (!is_array($skinparamValue)) {
143+
if (!\is_array($skinparamValue)) {
144144
$code[] = "skinparam {$skinparamKey} $skinparamValue";
145145
continue;
146146
}

Event/Event.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct($subject, Marking $marking, Transition $transition,
4343
if (null === $workflow) {
4444
@trigger_error(sprintf('Passing only three parameters to "%s" is deprecated since Symfony 4.1. Pass a %s instance as fourth parameter instead.', __METHOD__, WorkflowInterface::class), E_USER_DEPRECATED);
4545
$this->workflowName = 'unnamed';
46-
} elseif (is_string($workflow)) {
46+
} elseif (\is_string($workflow)) {
4747
@trigger_error(sprintf('Passing a string as the 4th parameter of "%s()" is deprecated since Symfony 4.1. Pass a %s instance instead.', __METHOD__, WorkflowInterface::class), E_USER_DEPRECATED);
4848
$this->workflowName = $workflow;
4949
} elseif ($workflow instanceof WorkflowInterface) {

EventListener/AuditTrailListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ public function __construct(LoggerInterface $logger)
3030
public function onLeave(Event $event)
3131
{
3232
foreach ($event->getTransition()->getFroms() as $place) {
33-
$this->logger->info(sprintf('Leaving "%s" for subject of class "%s" in workflow "%s".', $place, get_class($event->getSubject()), $event->getWorkflowName()));
33+
$this->logger->info(sprintf('Leaving "%s" for subject of class "%s" in workflow "%s".', $place, \get_class($event->getSubject()), $event->getWorkflowName()));
3434
}
3535
}
3636

3737
public function onTransition(Event $event)
3838
{
39-
$this->logger->info(sprintf('Transition "%s" for subject of class "%s" in workflow "%s".', $event->getTransition()->getName(), get_class($event->getSubject()), $event->getWorkflowName()));
39+
$this->logger->info(sprintf('Transition "%s" for subject of class "%s" in workflow "%s".', $event->getTransition()->getName(), \get_class($event->getSubject()), $event->getWorkflowName()));
4040
}
4141

4242
public function onEnter(Event $event)
4343
{
4444
foreach ($event->getTransition()->getTos() as $place) {
45-
$this->logger->info(sprintf('Entering "%s" for subject of class "%s" in workflow "%s".', $place, get_class($event->getSubject()), $event->getWorkflowName()));
45+
$this->logger->info(sprintf('Entering "%s" for subject of class "%s" in workflow "%s".', $place, \get_class($event->getSubject()), $event->getWorkflowName()));
4646
}
4747
}
4848

EventListener/ExpressionLanguage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function registerFunctions()
4141

4242
$errors = $variables['validator']->validate($object, null, $groups);
4343

44-
return 0 === count($errors);
44+
return 0 === \count($errors);
4545
});
4646
}
4747
}

Metadata/GetMetadataTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public function getMetadata(string $key, $subject = null)
4343
return $metadataBag[$key] ?? null;
4444
}
4545

46-
throw new InvalidArgumentException(sprintf('Could not find a MetadataBag for the subject of type "%s".', is_object($subject) ? get_class($subject) : gettype($subject)));
46+
throw new InvalidArgumentException(sprintf('Could not find a MetadataBag for the subject of type "%s".', \is_object($subject) ? \get_class($subject) : \gettype($subject)));
4747
}
4848
}

Registry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function get($subject, $workflowName = null)
6060
}
6161

6262
if (!$matched) {
63-
throw new InvalidArgumentException(sprintf('Unable to find a workflow for class "%s".', get_class($subject)));
63+
throw new InvalidArgumentException(sprintf('Unable to find a workflow for class "%s".', \get_class($subject)));
6464
}
6565

6666
return $matched;

Validator/StateMachineValidator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ public function validate(Definition $definition, $name)
2424
$transitionFromNames = array();
2525
foreach ($definition->getTransitions() as $transition) {
2626
// Make sure that each transition has exactly one TO
27-
if (1 !== count($transition->getTos())) {
28-
throw new InvalidDefinitionException(sprintf('A transition in StateMachine can only have one output. But the transition "%s" in StateMachine "%s" has %d outputs.', $transition->getName(), $name, count($transition->getTos())));
27+
if (1 !== \count($transition->getTos())) {
28+
throw new InvalidDefinitionException(sprintf('A transition in StateMachine can only have one output. But the transition "%s" in StateMachine "%s" has %d outputs.', $transition->getName(), $name, \count($transition->getTos())));
2929
}
3030

3131
// Make sure that each transition has exactly one FROM
3232
$froms = $transition->getFroms();
33-
if (1 !== count($froms)) {
34-
throw new InvalidDefinitionException(sprintf('A transition in StateMachine can only have one input. But the transition "%s" in StateMachine "%s" has %d inputs.', $transition->getName(), $name, count($froms)));
33+
if (1 !== \count($froms)) {
34+
throw new InvalidDefinitionException(sprintf('A transition in StateMachine can only have one input. But the transition "%s" in StateMachine "%s" has %d inputs.', $transition->getName(), $name, \count($froms)));
3535
}
3636

3737
// Enforcing uniqueness of the names of transitions starting at each node

Validator/WorkflowValidator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function validate(Definition $definition, $name)
3232
$places = array_fill_keys($definition->getPlaces(), array());
3333
foreach ($definition->getTransitions() as $transition) {
3434
foreach ($transition->getFroms() as $from) {
35-
if (in_array($transition->getName(), $places[$from])) {
35+
if (\in_array($transition->getName(), $places[$from])) {
3636
throw new InvalidDefinitionException(sprintf('All transitions for a place must have an unique name. Multiple transitions named "%s" where found for place "%s" in workflow "%s".', $transition->getName(), $from, $name));
3737
}
3838
$places[$from][] = $transition->getName();
@@ -44,8 +44,8 @@ public function validate(Definition $definition, $name)
4444
}
4545

4646
foreach ($definition->getTransitions() as $transition) {
47-
if (1 < count($transition->getTos())) {
48-
throw new InvalidDefinitionException(sprintf('The marking store of workflow "%s" can not store many places. But the transition "%s" has too many output (%d). Only one is accepted.', $name, $transition->getName(), count($transition->getTos())));
47+
if (1 < \count($transition->getTos())) {
48+
throw new InvalidDefinitionException(sprintf('The marking store of workflow "%s" can not store many places. But the transition "%s" has too many output (%d). Only one is accepted.', $name, $transition->getName(), \count($transition->getTos())));
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)