Skip to content
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

Fixed - renamed misleading method name deleteById to deleteBySku to … #4764

Closed
wants to merge 4 commits into from
Closed

Fixed - renamed misleading method name deleteById to deleteBySku to … #4764

wants to merge 4 commits into from

Conversation

nimmneun
Copy link

… reflect actual behavior and added interface comment. Updated corresponding webapi.xml + inconsistent whitespacing.
ProductRepositoryTest result: OK (34 tests, 177 assertions). Created dummy StoreExtensionInterface to run test (not commited).

…eflect actual behavior and added interface comment
@orlangur
Copy link
Contributor

Nice catch 👍

However, since maintainable version was released we cannot fix such sort of flaw this way (see http://devdocs.magento.com/guides/v2.0/architecture/backward-compatibility.html).

Please add a new method deleteBySku and mark an old method deleteById as @deprecated.

…Sku to reflect actual behavior and added interface comment"

This reverts commit 55c1d2d.
@nimmneun
Copy link
Author

Oh - I see =) like so? @see last commit.

@orlangur
Copy link
Contributor

Yep, that's it! Looks good to me now, let's wait for Magento folks.

@adragus-inviqa
Copy link
Contributor

Please always remember to add more info when deprecating.
I.e. @deprecated <Reason for deprecation> <What to use instead, if applicable>.

@nimmneun
Copy link
Author

@adragus-inviqa thanks for the heads up =) Funny part is ... I actually wrote a deprecation notice at frist (since its mandatory in my dayjob), but looked@how it was previously done and removed my notice :p ... will do in the future.

@adragus-inviqa
Copy link
Contributor

Why in the future? Why not now? People will ask themselves why is that deprecated.

@nimmneun
Copy link
Author

true =) done

@vkublytskyi vkublytskyi added the MX label May 31, 2016
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws \Magento\Framework\Exception\StateException
*/
public function deleteBySku($sku);

Choose a reason for hiding this comment

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

Unfortunately this is still backward incompatible change as if exists other implementation of this interface it will be broken after new method addition.

Copy link
Contributor

Choose a reason for hiding this comment

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

It does not matter. Unlike the method removal, it's feasible for 2.1, similar to situation described in #4749

@vrann
Copy link
Contributor

vrann commented Mar 25, 2017

@nimmneun please update your code with the latest develop

@ishakhsuvarov ishakhsuvarov added this to the April 2017 milestone Apr 20, 2017
@ishakhsuvarov ishakhsuvarov self-assigned this Apr 20, 2017
@ishakhsuvarov
Copy link
Contributor

@nimmneun Closing this PR for now due to inactivity.
If you wish to continue – please merge with the latest develop and reopen.

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.

None yet

8 participants