Skip to content

Commit

Permalink
minor #29745 SCA: minor code tweaks (kalessil)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 4.1 branch (closes #29745).

Discussion
----------

SCA: minor code tweaks

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Eliminated a few excessive calls, tweaked query parameters sorting

Commits
-------

8887f76 SCA: minor code tweaks
  • Loading branch information
fabpot committed Jan 13, 2019
2 parents c325155 + 8887f76 commit 1874369
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Expand Up @@ -563,9 +563,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
$metadataStoreDefinition->replaceArgument(2, $transitionsMetadataDefinition);

// Create places
$places = array_map(function (array $place) {
return $place['name'];
}, $workflow['places']);
$places = array_column($workflow['places'], 'name');

// Create a Definition
$definitionDefinition = new Definition(Workflow\Definition::class);
Expand Down
Expand Up @@ -62,9 +62,7 @@ public function lateCollect()
});

// Keep the messages clones only
$this->data['messages'] = array_map(function (array $item): Data {
return $item[0];
}, $messages);
$this->data['messages'] = array_column($messages, 0);
}

/**
Expand Down
Expand Up @@ -71,7 +71,8 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata)
if (isset($xml->{'discriminator-map'})) {
$mapping = array();
foreach ($xml->{'discriminator-map'}->mapping as $element) {
$mapping[(string) $element->attributes()->type] = (string) $element->attributes()->class;
$elementAttributes = $element->attributes();
$mapping[(string) $elementAttributes->type] = (string) $elementAttributes->class;
}

$classMetadata->setClassDiscriminatorMapping(new ClassDiscriminatorMapping(
Expand Down

0 comments on commit 1874369

Please sign in to comment.