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

Adds a null check to label templates, adds return types for validation methods #16040

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

Godmartinz
Copy link
Collaborator

@Godmartinz Godmartinz commented Jan 8, 2025

This adds a null check on the validation of the template for labels and a return type for the validation methods.

adds a notification if template is null:
image

This checks if the template selection is not null in the db at save and while trying to render the label preview

Copy link

what-the-diff bot commented Jan 8, 2025

PR Summary

  • Introduction of Return Type Declarations
    Several methods (validate, validateUnits, validateSize, validateMargins, and validateSupport) in Label.php have been improved by defining their return type as void. This means these methods will not return any value, making the program more predictable and easier to debug.

  • Improved Error Handling Mechanism
    Error handling has been enhanced in the render method of Label.php. If the $template variable is null, it now throws an exception. This enhancement provides a robust method to catch and deal with potential errors in code execution, helping to maintain the stability of the application.

@Godmartinz Godmartinz requested review from marcusmoore and snipe and removed request for snipe January 8, 2025 18:02
Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

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

Quick question

app/View/Label.php Outdated Show resolved Hide resolved
@Godmartinz Godmartinz requested a review from marcusmoore January 8, 2025 20:14
app/View/Label.php Outdated Show resolved Hide resolved
Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

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

Couple (hopefully) quick things

app/Http/Controllers/SettingsController.php Outdated Show resolved Hide resolved
app/View/Label.php Outdated Show resolved Hide resolved
Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

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

Looks good 👍🏾

@Godmartinz Godmartinz requested a review from snipe January 16, 2025 21:24
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.

3 participants