Skip to content

Instantly share code, notes, and snippets.

@thiagomarini
Last active December 20, 2018 12:15

Revisions

  1. thiagomarini revised this gist Dec 20, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion service_response_example.php
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    <?php

    namespace Weengs\Services\Merchant\Onboarding\RequestCall;
    namespace Weengs\Services\Merchant\Onboarding\RequestPhoneCall;

    use Weengs\Models\User\User;
    use Weengs\Services\Common\BaseServiceResponse;
  2. thiagomarini revised this gist Dec 18, 2018. 1 changed file with 2 additions and 10 deletions.
    12 changes: 2 additions & 10 deletions service_response_example.php
    Original file line number Diff line number Diff line change
    @@ -2,31 +2,23 @@

    namespace Weengs\Services\Merchant\Onboarding\RequestCall;

    use Weengs\Models\User\Onboarding;
    use Weengs\Models\User\User;
    use Weengs\Services\Common\BaseServiceResponse;

    class Response extends BaseServiceResponse
    {
    /**
    * @var Onboarding
    */
    private $onboarding;

    /**
    * @var User
    */
    private $user;

    /**
    * @param Onboarding $onboarding
    * @param User $user
    */
    public function __construct(Onboarding $onboarding, User $user)
    public function __construct(User $user)
    {
    parent::__construct();

    $this->onboarding = $onboarding;
    $this->user = $user;
    }

    @@ -36,7 +28,7 @@ public function __construct(Onboarding $onboarding, User $user)
    public function getData(): array
    {
    $response = [
    'onboarding' => $this->onboarding->toResource(),
    'onboarding' => $this->user->onboarding->toResource(),
    'user' => $this->user->toResource()
    ];

  3. thiagomarini created this gist Dec 6, 2018.
    45 changes: 45 additions & 0 deletions service_response_example.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    <?php

    namespace Weengs\Services\Merchant\Onboarding\RequestCall;

    use Weengs\Models\User\Onboarding;
    use Weengs\Models\User\User;
    use Weengs\Services\Common\BaseServiceResponse;

    class Response extends BaseServiceResponse
    {
    /**
    * @var Onboarding
    */
    private $onboarding;

    /**
    * @var User
    */
    private $user;

    /**
    * @param Onboarding $onboarding
    * @param User $user
    */
    public function __construct(Onboarding $onboarding, User $user)
    {
    parent::__construct();

    $this->onboarding = $onboarding;
    $this->user = $user;
    }

    /**
    * @return array
    */
    public function getData(): array
    {
    $response = [
    'onboarding' => $this->onboarding->toResource(),
    'user' => $this->user->toResource()
    ];

    return $response;
    }
    }