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

Rename methods #29

Closed
igorocampos opened this issue Nov 25, 2022 · 0 comments · Fixed by #37
Closed

Rename methods #29

igorocampos opened this issue Nov 25, 2022 · 0 comments · Fixed by #37

Comments

@igorocampos
Copy link
Owner

igorocampos commented Nov 25, 2022

PrintBarCode and PrintQRCode should be renamed as they don't actually print anything, but rather create the necessary command for a barcode/qrcode.

New name should be just Barcode and QRCode

As this is clearly a breaking change, we should first create the new Barcode() and QRCode() methods which will contain the actual code and the previous PrintBarCode and PrintQRCode must be marked as obsolete methods and instead of containing code, they must only call the newly created methods.

After this change is deployed, version should be bumped to 1.2.4 and the usage of the obsolete methods should just generate a warning by decorating the methods with the Obsolete attribute as shown below.

[Obsolete(nameof(PrintBarCode) + " is deprecated, please use "+ nameof(Barcode) + " instead.")]

On the next version, it must be bumped to 1.3.0 and the Obsolete attribute must be changed in order to throw a compilation error if the old method is used. This can be done by adding a new bool parameter to the attribute

[Obsolete(nameof(PrintBarCode) + " is deprecated, please use "+ nameof(Barcode) + " instead.", true)]

And then, on version 1.3.1 we can just get rid of the old methods :)

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

Successfully merging a pull request may close this issue.

1 participant