Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Workflow] Added DefinitionBuilder::setMetadataStore().#27190

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@vudaltsov
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

This PR complements#26092.

@vudaltsovvudaltsov requested a review fromlyrixx as acode ownerMay 7, 2018 20:15
@vudaltsovvudaltsov changed the titleAdded DefinitionBuilder::setMetadataStore().[Workflow] Added DefinitionBuilder::setMetadataStore().May 7, 2018
@vudaltsovvudaltsov changed the base branch frommaster to4.1May 7, 2018 20:30
@vudaltsovvudaltsovforce-pushed theworkflow-builder-metadata-store branch from04d528b to675e6fdCompareMay 7, 2018 20:35
* @param string[] $places
* @param Transition[] $transitions
* @param string|null $initialPlace
* @param MetadataStoreInterface|null $metadataStore

Choose a reason for hiding this comment

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

We prefer doing partial docblocks, keeping them only when they provide something over the signature:
instead of adding this, I'd suggest to remove the one for initialPlace

}

/**
* @param Transition $transition

Choose a reason for hiding this comment

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

should be removed (see previous comment)

}

/**
* @param MetadataStoreInterface $metadataStore

Choose a reason for hiding this comment

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

should be removed

@nicolas-grekasnicolas-grekas added this to the4.1 milestoneMay 7, 2018
@vudaltsov
Copy link
ContributorAuthor

@nicolas-grekas , thank you for explanations, done.

Copy link
Member

@lyrixxlyrixx left a comment

Choose a reason for hiding this comment

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

Thanks for this PR. I left a tiny comment ;)

@vudaltsov
Copy link
ContributorAuthor

@lyrixx , can't see it...

}

/**
* @return $this
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 use a type hint instead of a php doc

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

What type hint?: self?

Copy link
Member

Choose a reason for hiding this comment

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

yes ;)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

SupposeNewDefinitionBuilder extends our non-finalDefinitionBuilder. Then return type of$newDefinitionBuilder->setMetadataStore() will beDefinitionBuilder, notNewDefinitionBuilder.

Copy link
Member

Choose a reason for hiding this comment

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

Yes indeed. And it's not an issue ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

@lyrixx But method autocompletion in IDE for methods from the inherited class will stop after a call to a method withself as return type.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Typehinting fluent pattern with: self is okay in a fluent interface because you are not supposed to add any new public methods in it's implementations. And probably in a final class for the same reason.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

found some relevant occurrences in symfony code:
image
but I still don't agree it is correct...

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

With: self it is actually correct to do this:

<?phpclass A{publicfunctionfoo():self    {return$this;    }}class Bextends A{publicfunctionfoo():A    {returnnewA();    }}

It does not contradict the contract.

While@return $this indicates that the returned value should be the same instance.

sroze reacted with thumbs up emoji
Copy link
Member

@nicolas-grekasnicolas-grekasMay 9, 2018
edited
Loading

Choose a reason for hiding this comment

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

Makes sense to keep it as this provides more than just the return type.
In the code base, we use both return static and $this, dunno if there is a difference thought here.

}

/**
* @return $this
Copy link
Member

@nicolas-grekasnicolas-grekasMay 9, 2018
edited
Loading

Choose a reason for hiding this comment

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

Makes sense to keep it as this provides more than just the return type.
In the code base, we use both return static and $this, dunno if there is a difference thought here.

@fabpotfabpotforce-pushed theworkflow-builder-metadata-store branch from62b352c to2882f8dCompareMay 11, 2018 16:37
@fabpot
Copy link
Member

Thank you@vudaltsov.

@fabpotfabpot merged commit2882f8d intosymfony:4.1May 11, 2018
fabpot added a commit that referenced this pull requestMay 11, 2018
…(vudaltsov)This PR was squashed before being merged into the 4.1 branch (closes#27190).Discussion----------[Workflow] Added DefinitionBuilder::setMetadataStore().| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |This PR complements#26092.Commits-------2882f8d [Workflow] Added DefinitionBuilder::setMetadataStore().
@vudaltsovvudaltsov deleted the workflow-builder-metadata-store branchMay 11, 2018 16:39
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lyrixxlyrixxlyrixx left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@jvasseurjvasseurjvasseur left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

6 participants

@vudaltsov@fabpot@nicolas-grekas@lyrixx@jvasseur@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp