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

refactor: Cleanup test from @param annotations #768

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DannyvdSluijs
Copy link
Collaborator

@DannyvdSluijs DannyvdSluijs commented Nov 24, 2024

This pull request includes several changes to the test files in the tests directory, focusing on enforcing strict types, improving method signatures, and using generators for data providers. The most important changes include adding strict types, refactoring method signatures, and converting data providers to use generators for better performance and readability.

Enforcing Strict Types:

  • Added declare(strict_types=1); at the beginning of multiple test files to enforce strict type checking. (tests/Constraints/FactoryTest.php [1] tests/Constraints/VeryBaseTestCase.php [2] tests/Drafts/BaseDraftTestCase.php [3] tests/Entity/JsonPointerTest.php [4] tests/Rfc3339Test.php [5]

Refactoring Method Signatures:

  • Updated method signatures to use type hints for parameters and return types, improving code clarity and type safety. (tests/Constraints/FactoryTest.php [1] tests/Constraints/TypeTest.php [2] tests/Constraints/VeryBaseTestCase.php [3] tests/Drafts/BaseDraftTestCase.php [4] tests/Entity/JsonPointerTest.php [5] tests/Rfc3339Test.php [6]

Using Generators for Data Providers:

  • Converted array-based data providers to use generators, enhancing performance and readability. (tests/Constraints/FactoryTest.php [1] tests/Entity/JsonPointerTest.php [2] tests/Rfc3339Test.php [3]

@DannyvdSluijs DannyvdSluijs force-pushed the Replace-param-annotation-with-native-type-hint-in-tests branch from e360671 to 1702f6d Compare November 24, 2024 22:14

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (6)
  • tests/Constraints/FactoryTest.php: Language not supported
  • tests/Constraints/TypeTest.php: Language not supported
  • tests/Constraints/VeryBaseTestCase.php: Language not supported
  • tests/Drafts/BaseDraftTestCase.php: Language not supported
  • tests/Entity/JsonPointerTest.php: Language not supported
  • tests/Rfc3339Test.php: Language not supported
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