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

Interface for RFC specific field members #12

Open
leroy0211 opened this issue Feb 24, 2021 · 2 comments
Open

Interface for RFC specific field members #12

leroy0211 opened this issue Feb 24, 2021 · 2 comments

Comments

@leroy0211
Copy link

Feature Request

Q A
New Feature yes
RFC yes
BC Break no

Summary

An additional interface with some getters for the RFC specific field members (chapter 3.1) would be very nice to have.

I have often mistyped on those fields. Some interface which let a developer implement specific methods to be strict about it would be great.

Just of the top of my head...

interface StrictApiProblemInterface
{
    public function getType(): ?string
    public function getTitle(): string
    public function getStatus(): ?int
    public function getDetail(): ?string
    public function getExtensions(): array
}
@veewee
Copy link
Contributor

veewee commented Feb 24, 2021

Yeah that could make sense to provide. Want to give it a shot?

@olekhy
Copy link

olekhy commented Jul 28, 2021

hey! why get*() we are not in context of setting properties from a DTO instance.
my thoughts

interface StrictApiProblem 
{
    public function type(): ?string
    public function title(): string
    public function status(): ?int 
    public function detail(): ?string
}

interface UnstrictApiProblems
{
    // nothing found about approach how to declare multiple problems, see violation or another wording is not described on rfc
    public function problems(): ?array
}

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

No branches or pull requests

3 participants