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

Integrate SimpleDTO #16

Open
hopeseekr opened this issue Jun 4, 2019 · 1 comment
Open

Integrate SimpleDTO #16

hopeseekr opened this issue Jun 4, 2019 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@hopeseekr
Copy link
Member

It would be awesome to integrate phpexpertsinc/SimpleDTO with this project.

Minimally, we need the ability to specify what SimpleDTO class to return for any particular HTTP call.

Ideally, we would return every response as a blank + permissive SimpleDTO.

@hopeseekr hopeseekr added good first issue Good for newcomers help wanted Extra attention is needed labels Jun 4, 2019
@hopeseekr
Copy link
Member Author

A year+ later, I still can't figure out how to actually architect this.

What I've been doing is this:

    $response = $api->post('/uri', ['post' => 'data']);
    return new Read\AccountDTO((array) $response);

SimpleDTO's validation takes care of whether or not the API call succeeded or not.

I don't even know if this is so necessary anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Development

No branches or pull requests

1 participant