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

Add type hint, model hint, and timestamp cast #69

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

Conversation

rxrw
Copy link

@rxrw rxrw commented May 30, 2023

  1. Update phpunit.xml to new version
  2. Add type hint to all functions
  3. Add properties hint in all models
  4. (BREAKING CHANGES)Add casts to Carbon for timestamp field

1. Update `phpunit.xml` to new version
2. Add all type hint
3. Add properties hint in models
4. Add casts to Carbon for timestamp field(*Breaking changes*)
@rxrw
Copy link
Author

rxrw commented May 30, 2023

Hi, I have found this project which suits my requirement! I'm very appreciating your work.

In the process of development, I found there're some difficulties getting hints from IDE.

Above PHP 8 and Laravel 9, there's a recommendation to use type hint in order to make code more readable and easily to develop.

I have done them. Maybe the method hint in model is not fully supported, but it's enough to use. Many contributors and me will continue to make it more completely.

Please let me know if there're any issues, and I'm looking forwards to this PR to be merged ^-^

Due to the breaking changes in timestamp type, I think maybe there should have a major version change 🤔

@lucasdotvin lucasdotvin self-requested a review May 31, 2023 14:13
@lucasdotvin lucasdotvin added enhancement New feature or request good first issue Good for newcomers labels May 31, 2023
@lucasdotvin
Copy link
Owner

Hello! Thanks for the contributions! I'm gonna run some tests and then merge it! 🤘

@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Merging #69 (1d1f52a) into develop (86d227c) will decrease coverage by 1.01%.
The diff coverage is 99.07%.

@@              Coverage Diff              @@
##             develop      #69      +/-   ##
=============================================
- Coverage      98.20%   97.19%   -1.01%     
  Complexity       150      150              
=============================================
  Files             26       26              
  Lines            501      499       -2     
=============================================
- Hits             492      485       -7     
- Misses             9       14       +5     
Impacted Files Coverage Δ
src/Enums/PeriodicityType.php 100.00% <ø> (ø)
src/Models/Concerns/HasSubscriptions.php 96.00% <96.77%> (-0.02%) ⬇️
src/Models/Concerns/Expires.php 88.88% <100.00%> (-11.12%) ⬇️
src/Models/Concerns/ExpiresAndHasGraceDays.php 88.88% <100.00%> (-11.12%) ⬇️
src/Models/Concerns/HandlesRecurrence.php 100.00% <100.00%> (ø)
src/Models/Concerns/Starts.php 90.90% <100.00%> (-9.10%) ⬇️
src/Models/Concerns/Suppresses.php 90.90% <100.00%> (-9.10%) ⬇️
src/Models/Feature.php 100.00% <100.00%> (ø)
src/Models/FeatureConsumption.php 100.00% <100.00%> (ø)
src/Models/FeaturePlan.php 100.00% <100.00%> (ø)
... and 9 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants