8000 Tags · renfordt/larvatar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tags: renfordt/larvatar

Tags

v2.0.2

Toggle v2.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
v2.0.2 (#19)

* Add new dev tools and testing scripts to composer.json

Updated the dev dependencies with Rector, Laravel Pint, and Symfony Var-Dumper. Introduced custom scripts for refactoring, linting, type checking, unit testing, and combined testing routines. This enhances code quality checks and developer workflow automation.

* Add PHPStan configuration file with max analysis level

This commit introduces a `phpstan.neon` configuration file for static analysis. It sets the analysis level to maximum, specifies the `src` directory for scanning, and enables reporting of unmatched ignored errors. This helps ensure stricter code quality checks.

* Update PHPUnit configuration for stricter test validations

Adjusted the PHPUnit XML to include stricter test validation settings such as enforcing coverage metadata, failing on warnings, and risky tests. This ensures better quality control and improved debugging capabilities during test executions.

* Add Pint configuration file with PSR-12 preset

Introduced a `pint.json` file to enforce code style standards. The configuration uses the PSR-12 preset and enables `declare_strict_types` for stricter typing rules. This ensures consistency and improved code quality across the project.

* Enable strict typing and clean up docblock in Name.php

Added `declare(strict_types=1)` to enforce strict typing across the file. Removed unnecessary docblock that duplicated the method's type hint, improving code clarity and maintainability.

* Add strict typing, refactor methods, and enhance functionality

Enable `declare(strict_types=1)` across all files for stronger type checking. Refactor redundant code and inline conditions for better readability. Add new methods and properties to support extended functionality, e.g., symmetry, pixels, and form customization for avatars.

* Add strict type declaration to LarvatarServiceProvider

This ensures consistent type safety across the file, catching potential type-related issues during development. The change aligns the codebase with modern PHP development practices.

* Add rector.php configuration file

Introduce a Rector configuration file to automate code refactoring. It includes rules for dead code removal, code quality improvements, type declarations, and other optimizations. This ensures consistent and maintainable code standards across the project.

* Add strict types and attribute #[CoversClass] to tests

This update enforces strict typing across all test files and introduces the #[CoversClass] attribute to improve test coverage annotations. Additionally, minor improvements such as explicit return type hints were added for better code clarity.

* Refactor avatar generation and improve type handling

Reworked avatar type handling to separate InitialsAvatar and Identicon instances, deprecating mixed use of Avatar. Updated related methods and tests to reflect the refactored structure, ensuring stricter type safety and thorough test coverage.

* Update .gitignore to include .phpunit.cache

Added .phpunit.cache to the .gitignore file to prevent caching files generated by PHPUnit from being tracked in the repository. This helps keep the repository clean and avoids unnecessary clutter.

* Add autoloading for test namespace in composer.json

This change adds the "Renfordt\\Larvatar\\Tests\\" namespace to the autoload section, pointing it to the "tests" directory. It ensures proper namespace mapping for test classes during development and testing.

* Refactor avatar handling and improve Gravatar validation

Introduced a dedicated User model to encapsulate avatar logic, improving test modularity by replacing trait tests with User tests. Enhanced Gravatar validation by adding explicit exceptions for unsupported LarvatarTypes. Reorganized namespaces for consistency across test classes.

* Refactor GitHub Actions workflow for PHP tests

Simplified and streamlined the CI workflow, merging jobs and renaming the workflow file to `test.yml`. Improved test matrix to include multiple OS and PHP versions with dependency variations. Added caching for Composer dependencies to enhance performance.

* Update dependency versions for clamp and colors packages

Bump the versions of renfordt/clamp and renfordt/colors to ^v1.0.1 and ^v1.0.3, respectively, in composer.json. Ensures compatibility with the latest improvements and bug fixes in these dependencies.

* Remove orchestra/testbench from require-dev in composer.json

The package was unnecessary for the current project setup. This reduces dependencies and simplifies development configurations.

* Add GD extension to GitHub Actions PHP workflow

GD extension is now included in the PHP setup to support graphics-related tests or features. This ensures compatibility with functions or libraries that depend on GD in the project.

* Add Faker and Testbench dependencies to composer.json

Added `fakerphp/faker` for generating fake data and `orchestra/testbench` to streamline Laravel package testing. These additions enhance development and testing capabilities.

* Add fileinfo extension to GitHub Actions test workflow

The fileinfo PHP extension is now included in the test workflow setup. This ensures compatibility with features or tests requiring fileinfo to function properly.

v2.0.1

Toggle v2.0.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
v2.0.1 (#18)

* Use short array syntax for color set assignment

Replaced the `list()` syntax with short array syntax `[]` for assigning `$darkColor` and `$lightColor`. This improves code readability and aligns with modern PHP standards.

* Add release configuration for automated changelogs

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.

* Update PHP and dependencies to latest versions

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.

* Remove PHP 8.1 from GitHub Actions workflow.

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.

* Use DataProvider attribute in Avatar tests

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.

* Update type hints and remove @ExpectedException annotations

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.

* Make test data providers static and use attributes for tests

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.

* Implement attributes-based DataProvider in LarvatarTraitTest

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.

* Refactor formatting and inline concatenations

Reformat docblock parameters for consistent style and improve readability. Replace inline string concatenations with clearer spacing and streamline conditional logic.

* Refactor docblocks and reorganize `getHexColor` method.

Standardize docblock formatting for consistency and clarity. Reorder the `getHexColor` method for better code structure and readability.

* Simplify and correct docblock annotations.

Updated the docblock formatting for better consistency and readability. Added type specificity to the return annotation to improve clarity and type safety.

* Update PHPDoc return types for matrix methods

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.

* Cast lightness values to float in Avatar setters

Ensure `backgroundLightness` and `textLightness` values are explicitly cast to float after clamping. This improves type clarity and ensures consistent data handling across the application.

* Update bug report template with new version options

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.

* Remove LarvatarServiceProvider class file

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.

* Revert "Remove LarvatarServiceProvider class file"

This reverts commit 22ca3c8.

* Comment out unused Larvatar instantiation in ServiceProvider.

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.

* Refactor LarvatarTrait to return Larvatar instances.

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.

* Add customization methods for avatar font and background

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.

* Update README with detailed usage instructions

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.

* Update `getAvatar` method signature in LarvatarTrait

Added optional parameters `$size` and `$encoding` to the abstract `getAvatar` method. This allows more flexibility in specifying avatar dimensions and encoding preferences.

* Refactor LarvatarTraitTest to use instance variables.

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.

* Update Larvatar font color assertions in tests

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.

* Refactor LarvatarTraitTest to simplify method calls.

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.

* Add a check for avatar existence in setWeight method

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.

* Update default font weight in test from 'bold' to 'normal'

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.

* Update avatar method to support custom size and encoding options

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.

* Update avatar size setting to use dynamic input

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.

* Update UPGRADING.md with new avatar usage instructions

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.
```

* Add method to generate Gravatar HTML image tag

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.

* Add unit tests for Gravatar getHTML method

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.

* Add static factory methods `make` and `create` to Larvatar

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.

* Add new tests for Larvatar creation methods

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.

* Add create() method to Name class

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.

* Add tests for Name::make() and Name::create() methods

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.

v2.0.0

Toggle v2.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
v2.0.0 (#17)

* Use short array syntax for color set assignment

Replaced the `list()` syntax with short array syntax `[]` for assigning `$darkColor` and `$lightColor`. This improves code readability and aligns with modern PHP standards.

* Add release configuration for automated changelogs

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.

* Update PHP and dependencies to latest versions

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.

* Remove PHP 8.1 from GitHub Actions workflow.

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.

* Use DataProvider attribute in Avatar tests

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.

* Update type hints and remove @ExpectedException annotations

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.

* Make test data providers static and use attributes for tests

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.

* Implement attributes-based DataProvider in LarvatarTraitTest

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.

* Refactor formatting and inline concatenations

Reformat docblock parameters for consistent style and improve readability. Replace inline string concatenations with clearer spacing and streamline conditional logic.

* Refactor docblocks and reorganize `getHexColor` method.

Standardize docblock formatting for consistency and clarity. Reorder the `getHexColor` method for better code structure and readability.

* Simplify and correct docblock annotations.

Updated the docblock formatting for better consistency and readability. Added type specificity to the return annotation to improve clarity and type safety.

* Update PHPDoc return types for matrix methods

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.

* Cast lightness values to float in Avatar setters

Ensure `backgroundLightness` and `textLightness` values are explicitly cast to float after clamping. This improves type clarity and ensures consistent data handling across the application.

* Update bug report template with new version options

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.

* Remove LarvatarServiceProvider class file

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.

* Revert "Remove LarvatarServiceProvider class file"

This reverts commit 22ca3c8.

* Comment out unused Larvatar instantiation in ServiceProvider.

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.

* Refactor LarvatarTrait to return Larvatar instances.

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.

* Add customization methods for avatar font and background

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.

* Update README with detailed usage instructions

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.

* Update `getAvatar` method signature in LarvatarTrait

Added optional parameters `$size` and `$encoding` to the abstract `getAvatar` method. This allows more flexibility in specifying avatar dimensions and encoding preferences.

* Refactor LarvatarTraitTest to use instance variables.

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.

* Update Larvatar font color assertions in tests

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.

* Refactor LarvatarTraitTest to simplify method calls.

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.

* Add a check for avatar existence in setWeight method

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.

* Update default font weight in test from 'bold' to 'normal'

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.

* Update avatar method to support custom size and encoding options

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.

* Update avatar size setting to use dynamic input

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.

* Update UPGRADING.md with new avatar usage instructions

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.

v2.0.0-beta2

Toggle v2.0.0-beta2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2.0.0-beta2 (#16)

* Use short array syntax for color set assignment

Replaced the `list()` syntax with short array syntax `[]` for assigning `$darkColor` and `$lightColor`. This improves code readability and aligns with modern PHP standards.

* Add release configuration for automated changelogs

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.

* Update PHP and dependencies to latest versions

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.

* Remove PHP 8.1 from GitHub Actions workflow.

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.

* Use DataProvider attribute in Avatar tests

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.

* Update type hints and remove @ExpectedException annotations

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.

* Make test data providers static and use attributes for tests

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.

* Implement attributes-based DataProvider in LarvatarTraitTest

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.

* Refactor formatting and inline concatenations

Reformat docblock parameters for consistent style and improve readability. Replace inline string concatenations with clearer spacing and streamline conditional logic.

* Refactor docblocks and reorganize `getHexColor` method.

Standardize docblock formatting for consistency and clarity. Reorder the `getHexColor` method for better code structure and readability.

* Simplify and correct docblock annotations.

Updated the docblock formatting for better consistency and readability. Added type specificity to the return annotation to improve clarity and type safety.

* Update PHPDoc return types for matrix methods

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.

* Cast lightness values to float in Avatar setters

Ensure `backgroundLightness` and `textLightness` values are explicitly cast to float after clamping. This improves type clarity and ensures consistent data handling across the application.

* Update bug report template with new version options

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.

v2.0.0-beta1

Toggle v2.0.0-beta1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #13 from renfordt/dev

v2.0.0

v1.4.1

Toggle v1.4.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #11 from renfordt/dev

Add possibility to access the base64 string

v1.4.0

Toggle v1.4.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #9 from renfordt/dev

v1.4.0

v1.3.1

Toggle v1.3.1's commit message
Add color manipulation tests to ColorTest.php

This commit introduces several tests for the Color class, testing various color manipulation functions such as darken, brighten, and getColorSet. These tests are important for ensuring that the color calculation logic is working correctly and producing the expected results.

v1.3.0

Toggle v1.3.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #6 from renfordt/dev

Reliable color sets & automated font size

v1.2.0

Toggle v1.2.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #5 from renfordt/dev

Refactoring and base64
0