Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Workflow] Remove unnecessary method calls #21784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Conversation

izzyp
Copy link
Contributor

@izzyp izzyp commented Feb 27, 2017

Q A
Branch? 3.2
Bug fix? yes
New feature? no
License MIT

getEnabledTransitions() method only requires 1 parameter "$subject".

Removed places where a second parameter "$this->getMarking($subject)" is being passed to getEnabledTransitions().

getEnabledTransitions() method only requires 1 parameter "$subject". 
Removed instances where a second $this->getMarking($subject) is being passed to getEnabledTransitions().
@izzyp izzyp changed the title Patch 1 [Workflow] Remove unnecessary method calls Feb 27, 2017
@hhamon
Copy link
Contributor

hhamon commented Feb 27, 2017

Looks like you opened your PR against the wrong branch or forgot to rebase it.

@nicolas-grekas nicolas-grekas changed the base branch from 3.2 to master February 27, 2017 17:18
@nicolas-grekas nicolas-grekas added this to the 3.2 milestone Feb 27, 2017
MarkingStore->setMarking() is being called on every call to getMarking() in the Workflow class. 

This is only required if a new Marking is initialised and set as per line 63:
`$marking->mark($this->definition->getInitialPlace());`

If the Marking is not new, the subject either already has a marking and we don't need to call setMarking(), or it is new && theres no `initial place`. In that case an Exception is thrown on line 61.
@fabpot
Copy link
Member

fabpot commented Feb 27, 2017

ping @lyrixx

Comply with Coding Standard.
Copy link
Member

@lyrixx lyrixx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 expect a little comment.

@@ -61,6 +61,9 @@ public function getMarking($subject)
throw new LogicException(sprintf('The Marking is empty and there is no initial place for workflow "%s".', $this->name));
}
$marking->mark($this->definition->getInitialPlace());

// Because the marking could have been initialized, we update the subject
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this comment because now, it's clear the marking has been updated.

Copy link
Contributor Author

@izzyp izzyp Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment updated in 7edad79.

@lyrixx
Copy link
Member

lyrixx commented Feb 28, 2017

👍

@izzyp
Copy link
Contributor Author

izzyp commented Feb 28, 2017

@lyrixx

Q: how often do you release patches?

Is there a specific timeline for v3.2.5?

(new to symfony dev cycle, couldn't find this detailed anywhere..)

@stof
Copy link
Member

stof commented Feb 28, 2017

@izzyp we do patch releases once a month (except when a security issue requires us to release an extra one faster)

@nicolas-grekas
Copy link
Member

Thank you @izzyp.

nicolas-grekas added a commit that referenced this pull request Feb 28, 2017
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #21784).

Discussion
----------

[Workflow] Remove unnecessary method calls

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| License       | MIT

getEnabledTransitions() method only requires 1 parameter "$subject".

Removed places where a second parameter "$this->getMarking($subject)" is being passed to getEnabledTransitions().

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

12d9129 [Workflow] Remove unnecessary method calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants