Skip to content

Commit

Permalink
minor #20479 [Workflow] Removed private Definition::addPlaces (Nyholm)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Workflow] Removed private Definition::addPlaces

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

There is no need for this method

Commits
-------

c546857 Removed private Definition::addPlaces
  • Loading branch information
lyrixx committed Nov 10, 2016
2 parents d293f60 + c546857 commit f8fb91b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/Symfony/Component/Workflow/Definition.php
Expand Up @@ -32,11 +32,15 @@ final class Definition
*/
public function __construct(array $places, array $transitions, $initialPlace = null)
{
$this->addPlaces($places);
$this->setInitialPlace($initialPlace);
foreach ($places as $place) {
$this->addPlace($place);
}

foreach ($transitions as $transition) {
$this->addTransition($transition);
}

$this->setInitialPlace($initialPlace);
}

/**
Expand Down Expand Up @@ -89,13 +93,6 @@ private function addPlace($place)
$this->places[$place] = $place;
}

private function addPlaces(array $places)
{
foreach ($places as $place) {
$this->addPlace($place);
}
}

private function addTransition(Transition $transition)
{
$name = $transition->getName();
Expand Down

0 comments on commit f8fb91b

Please sign in to comment.