Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Support union type in casters #210

Merged
merged 11 commits into from
Aug 11, 2021
Merged

Support union type in casters #210

merged 11 commits into from
Aug 11, 2021

Conversation

daniser
Copy link
Contributor

@daniser daniser commented May 13, 2021

Closes #209

@daniser daniser requested a review from brendt June 2, 2021 14:48
@brendt
Copy link
Contributor

brendt commented Jun 21, 2021

Can you submit tests that verify everything works as intended?

@daniser
Copy link
Contributor Author

daniser commented Jun 21, 2021

Can you submit tests that verify everything works as intended?

Done!

@brendt
Copy link
Contributor

brendt commented Jul 15, 2021

Sorry for the late response.

Can you explain how this example works?

    #[CastWith(RoundingCaster::class)]
    public float | int $bar;

RoundingCaster will always cast to float, so why would int still be needed there?

Sergey Danilchenko added 2 commits July 15, 2021 15:39
# Conflicts:
#	README.md
#	src/Casters/ArrayCaster.php
@daniser
Copy link
Contributor Author

daniser commented Jul 15, 2021

Sorry for the late response.

Can you explain how this example works?

    #[CastWith(RoundingCaster::class)]
    public float | int $bar;

RoundingCaster will always cast to float, so why would int still be needed there?

It was my oversight; fixed.

# Conflicts:
#	README.md
#	src/Casters/ArrayCaster.php
@brendt brendt merged commit 060ed27 into spatie:master Aug 11, 2021
@brendt
Copy link
Contributor

brendt commented Aug 11, 2021

Thanks!

@brendt
Copy link
Contributor

brendt commented Aug 11, 2021

@sidigi
Copy link

sidigi commented Aug 11, 2021

finaly

@suyar
Copy link

suyar commented Aug 11, 2021

Good job.

@daniser daniser deleted the union-type-support branch August 11, 2021 13:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants