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

Skip to content

make product variant comparable#11580

Merged
lchrusciel merged 1 commit into
Sylius:1.7from
oallain:product-variant-comparable
Jul 6, 2020
Merged

make product variant comparable#11580
lchrusciel merged 1 commit into
Sylius:1.7from
oallain:product-variant-comparable

Conversation

@oallain
Copy link
Copy Markdown
Contributor

@oallain oallain commented Jun 15, 2020

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #11487, like as #11329
License MIT

@oallain oallain requested a review from a team as a code owner June 15, 2020 20:38
@lchrusciel
Copy link
Copy Markdown
Contributor

Hey Olivier,

can you rebase to newest 1.7? It may fix the build.

@oallain oallain force-pushed the product-variant-comparable branch 2 times, most recently from 501402e to 6e146c4 Compare June 16, 2020 18:03
@probot-autolabeler probot-autolabeler Bot added the Maintenance CI configurations, READMEs, releases, etc. label Jun 16, 2020
@oallain oallain force-pushed the product-variant-comparable branch 2 times, most recently from 98d3641 to 322894f Compare June 17, 2020 19:02
@oallain
Copy link
Copy Markdown
Contributor Author

oallain commented Jun 18, 2020

Hi @lchrusciel ,

Rebase is done, and "application" is green on Travis, but "doc" still red 😞

@lchrusciel
Copy link
Copy Markdown
Contributor

lchrusciel commented Jun 19, 2020

Our 1.7 branch is red again, we will try to fix it in the nearest days

@oallain oallain force-pushed the product-variant-comparable branch from 322894f to a5efeb5 Compare June 21, 2020 15:00
@oallain oallain changed the base branch from 1.7 to master June 21, 2020 15:00
@oallain oallain force-pushed the product-variant-comparable branch from a5efeb5 to 077042a Compare June 21, 2020 15:06
*/
public function compareTo($other): int
{
return $this->code === $other->getCode() ? 0 : 1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would also like to suggest using another interface because this 0 for 🥛 and 1 for ☕ is really tricky.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I understood correctly, for us it is indeed semantical equality when the codes are identical. Strong cooperation is used here more because of our standards rather than real need (as both codes will be strings)

@lchrusciel
Copy link
Copy Markdown
Contributor

Can you rebase again to 1.7? We could fix it there, I assume.

@oallain oallain force-pushed the product-variant-comparable branch from 077042a to 486597b Compare June 27, 2020 16:16
@lchrusciel lchrusciel changed the base branch from master to 1.7 June 30, 2020 08:06
@lchrusciel lchrusciel force-pushed the product-variant-comparable branch from 486597b to f7c0dd5 Compare June 30, 2020 08:06
@lchrusciel
Copy link
Copy Markdown
Contributor

The base of this pull-request was changed, you need fetch and reset your local branch
if you want to add new commits to this pull request. Reset before you pull, else commits
may become messed-up.

Unless you added new commits (to this branch) locally that you did not push yet,
execute git fetch origin && git reset "product-variant-comparable" to update your local branch.

Feel free to ask for assistance when you get stuck 👍

@lchrusciel lchrusciel merged commit ed28c9f into Sylius:1.7 Jul 6, 2020
@lchrusciel
Copy link
Copy Markdown
Contributor

Thank you, @oallain! 🎉

{
$this->setCode('test');

$otherTaxon = new ProductVariant();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
$otherTaxon = new ProductVariant();
$otherVariant = new ProductVariant();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance CI configurations, READMEs, releases, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nesting level too deep fatal error when changing variant position

3 participants