Skip to content

Conversation

@RichardAnderson
Copy link
Contributor

No description provided.

- larastan
@RichardAnderson RichardAnderson requested a review from Copilot May 25, 2025 17:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds unit tests, integrates Larastan for static analysis, and updates the CI pipeline to enforce code quality and test coverage. Key changes include new test actions for runnable and dispatchable actions, modifications to stub and trait files to use readonly classes, and updates to the composer and CI configuration.

Reviewed Changes

Copilot reviewed 42 out of 42 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Setup/Actions/DoRunnableAction.php Introduces a new test action using the IsRunnable trait
tests/Setup/Actions/DoDispatchableAction.php Introduces a new test action using the IsDispatchable trait
tests/Pest.php Sets up the testing framework configuration
stubs/dto.stub Updates stub file to declare classes as readonly
src/Traits/IsRunnable.php Adjusts the return value of the run method
src/Conversion/DataConverter.php Removes the check for a field allowing null values, potentially affecting missing data handling
src/Console/BaseStubCommand.php Changes several methods to abstract definitions and removes the force option check in file creation
src/Attributes/* Updates attribute classes to readonly
src/Analysis/FieldMetadata.php Changes FieldMetadata from having readonly properties to normal properties within a readonly class
src/Analysis/ClassMetadata.php Removes helper methods and updates readonly property declarations
phpunit.xml.dist, phpstan.neon.dist, composer.json, .github/workflows/pr.yml Updates and reorders configurations for testing, static analysis, and CI
Comments suppressed due to low confidence (3)

src/Conversion/DataConverter.php:50

  • The removal of the check for $field->allowsNull may cause missing data to be handled incorrectly. Consider restoring this condition to return null when the field allows null values.
if ($field->allowsNull) {

src/Console/BaseStubCommand.php:78

  • Removing the force option check (i.e. ! $this->option('force')) prevents bypassing the file existence check. Reintroduce the force option to allow developers to override file existence when needed.
if (File::exists($path)) {

src/Analysis/FieldMetadata.php:8

  • [nitpick] Changing properties from explicitly readonly to mutable in a readonly class may break immutability guarantees. Confirm that this change is intentional and aligned with the desired API design.
public string $propertyName,

@github-actions
Copy link

CI Pipeline Failed

Please address these issues before merging.

@codecov
Copy link

codecov bot commented May 25, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@RichardAnderson RichardAnderson merged commit 7084fd5 into main May 25, 2025
5 checks passed
@RichardAnderson RichardAnderson deleted the feat/unit_testing branch June 2, 2025 15:04
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.

2 participants