Skip to content

Introduce Align enum for text alignment in drawCell method - #40

Merged
andersonls merged 2 commits into
masterfrom
improvement/align-enum
Dec 15, 2025
Merged

Introduce Align enum for text alignment in drawCell method#40
andersonls merged 2 commits into
masterfrom
improvement/align-enum

Conversation

@andersonls

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces type safety for text alignment in the drawCell method by replacing the string-based alignment parameter with a new Align backed enum. The PR also fixes spelling errors in two test method names, changing "Especial" to "Special" and correcting "Charaters" to "Characters".

Key Changes:

  • Introduces a new Align backed enum with four values: LEFT ('L'), CENTER ('C'), RIGHT ('R'), and JUSTIFIED ('J')
  • Updates the drawCell method signature across AbstractBuilder, ZplBuilder, and PdfBuilder to use ?Align instead of string
  • Fixes spelling errors in test method names

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Enums/Align.php New backed string enum defining four alignment options (LEFT, CENTER, RIGHT, JUSTIFIED)
src/AbstractBuilder.php Updates abstract drawCell method signature to use ?Align parameter and updates documentation
src/ZplBuilder.php Implements nullable Align parameter with proper null-safety check before accessing the enum value
src/PdfBuilder.php Implements nullable Align parameter with null coalescing operator
tests/ZplTest.php Updates tests to use Align::CENTER enum and fixes spelling in test method names
README.md Updates example code to use Align::CENTER enum instead of string 'C'

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/PdfBuilder.php
Comment thread tests/ZplTest.php

Copilot AI commented Dec 14, 2025

Copy link
Copy Markdown
Contributor

@andersonls I've opened a new pull request, #41, to work on those changes. Once the pull request is ready, I'll request review from you.

* Add test case for drawCell with null align parameter

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: andersonls <1561038+andersonls@users.noreply.github.com>
@andersonls
andersonls merged commit 96411f1 into master Dec 15, 2025
7 checks passed
@andersonls
andersonls deleted the improvement/align-enum branch December 15, 2025 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants