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

v2.0.1 #18

Merged
merged 40 commits into from
Dec 19, 2024
Merged

v2.0.1 #18

merged 40 commits into from
Dec 19, 2024

Conversation

renfordt
Copy link
Owner

No description provided.

Replaced the `list()` syntax with short array syntax `[]` for assigning `$darkColor` and `$lightColor`. This improves code readability and aligns with modern PHP standards.
This commit introduces a `.github/release.yml` file to automate the generation of changelogs during releases. It categorizes changes into breaking changes, new features, bug fixes, and other updates based on labels. This improves clarity and streamlines the release process.
Upgraded the PHP requirement to 8.2 and updated development dependencies, including PHPUnit to 11.5 and Testbench to 9.7. These changes ensure compatibility with newer features and maintain alignment with the latest ecosystem standards.
This update streamlines the supported PHP versions in the CI pipeline by dropping PHP 8.1. Only PHP 8.2 and newer are now tested, reflecting a focus on more recent versions.
Replaced traditional `@dataProvider` annotations with `#[DataProvider]` attributes in test methods. This modernizes the code and improves readability while maintaining functionality. Additionally, updated provider methods to be `static` to match the attribute requirements.
Added the `mixed` return type hint to the `invokeMethod` function for stricter typing. Removed redundant `@expectedException` annotations as they are no longer needed with modern PHPUnit exception handling.
Updated all data provider methods to be static for compatibility with PHPUnit's attribute-based DataProvider system. Replaced legacy `@dataProvider` annotations with modern `#[DataProvider]` attributes for improved readability and maintainability.
Replaced traditional docblock-based `@dataProvider` annotations with PHPUnit's native attributes. This improves readability and aligns with modern PHPUnit versions. Additionally, some methods were refactored for better consistency and clarity.
Update PHP to 8.2 and dependencies to latest versions
Reformat docblock parameters for consistent style and improve readability. Replace inline string concatenations with clearer spacing and streamline conditional logic.
Standardize docblock formatting for consistency and clarity. Reorder the `getHexColor` method for better code structure and readability.
Updated the docblock formatting for better consistency and readability. Added type specificity to the return annotation to improve clarity and type safety.
Clarified the return types in PHPDoc annotations to provide more precise type information for symmetric matrix and matrix generation methods. This improves code readability and developer understanding of method outputs.
Ensure `backgroundLightness` and `textLightness` values are explicitly cast to float after clamping. This improves type clarity and ensures consistent data handling across the application.
Fixed potential bugs with PHPStan
Added support for versions 2.0.x and 1.4.x in the bug report dropdown menu. This ensures users can accurately select their software version when submitting issues.
The LarvatarServiceProvider.php file was deleted as it is no longer required. This cleanup helps streamline the codebase by removing unused or redundant service provider definitions.
The `make` call for `Renfordt\Larvatar\Larvatar` is commented out as it is not currently needed. This helps prevent unnecessary processing and improves code clarity.
Revised the `getLarvatar` method to return a Larvatar instance instead of an HTML string. This simplifies the API and aligns it with object-oriented design principles. The outdated `getAvatar` method is now marked as abstract for further customization.
Implemented methods to set font weight, font lightness, and background lightness in the Larvatar class. Added corresponding tests to validate the functionality, including edge cases for extreme lightness values. This enhances customization options for avatar generation.
Renamed "Usage" section to "Basic Usage" and added a code example for implementing the LarvatarTrait to generate user avatars. Clarified method requirements and provided guidance for customization.
Added optional parameters `$size` and `$encoding` to the abstract `getAvatar` method. This allows more flexibility in specifying avatar dimensions and encoding preferences.
Replaced method parameters with private instance variables for name, email, and type in LarvatarTraitTest. Introduced a new getAvatar method to streamline avatar generation. This improves code readability and encapsulates avatar-related logic.
Adjusted SVG font color expectations in `LarvatarTest` to use precise hex color values instead of RGBA. This aligns test cases with updated font rendering logic for consistent validation.
Updated test methods to use pre-defined class properties and removed redundant parameters in `getAvatar` calls. Enhanced clarity by assigning default values to properties and adjusting method signatures accordingly.
This update ensures the setWeight method does not attempt to set the font weight if the avatar property is not initialized. Preventing potential errors, it improves the robustness of the method.
This change ensures consistency with the expected behavior and output of the Larvatar component. Adjusting the font weight helps align the test case with current implementation standards.
Refactored the `getAvatar` method to include parameters for avatar size and encoding preference. Adjusted function documentation and implementation to reflect these changes, improving flexibility and usability.
Replaced the hardcoded size of 32 with a dynamic parameter `$size` in the `getAvatar` method. This allows more flexibility when generating avatars based on varying size requirements.
This update revises the upgrade guide to reflect changes in Larvatar 2.0, including the requirement to define `getAvatar()` when using `LarvatarTrait`. It also introduces new static methods (`make`/`create`) and describes available avatar types with examples.
Refactor Gravatar.php for improved code clarity.

Removed unnecessary extra spaces in method signatures and adjusted string concatenation to use consistent spacing. Enhanced readability by formatting multiline exceptions and other code elements.
```
Introduced a `getHTML` method to generate an HTML image tag with the Gravatar URL as the source. This enhances usability by encapsulating the HTML generation within the class. Included documentation and exception annotations for better clarity.
This commit introduces tests for getHTML with default settings, custom sizes, and specific Gravatar types. These tests ensure the generated HTML image tags are accurate and handle variations correctly, improving confidence in the method's behavior.
Introduces `make` and `create` methods to simplify the instantiation of Larvatar objects. `create` internally calls `make` for consistency, providing a clear API for constructing Larvatar instances with type, name, and email parameters.
Introduced tests for `make`, `create`, and `create` with `Name` to validate the generation of Larvatar instances. These ensure the correct SVG output and improve coverage for different creation approaches.
Introduced a create() method to provide an alternative to make(). This method includes proper documentation and mirrors the functionality of make(), improving clarity and usability.
Introduces new test cases to verify Name::make() and Name::create() methods produce correct initials using the existing data provider. This ensures both methods behave as expected when generating initials from name inputs.
@renfordt renfordt merged commit b1263ea into main Dec 19, 2024
9 checks passed
@renfordt renfordt deleted the dev branch December 19, 2024 22:25
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.

1 participant