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

Feature | V2 Better Merging Pipeline #144

Merged
merged 4 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed getRawResponse
  • Loading branch information
Sammyjo20 committed Jan 24, 2023
commit ea749d3a7ddbcbb09713fabe7c1a4e544d8793ef
2 changes: 2 additions & 0 deletions src/Contracts/Pipeline.php
Original file line number Diff line number Diff line change
@@ -1,5 1,7 @@
<?php

declare(strict_types=1);

namespace Saloon\Contracts;

interface Pipeline
Expand Down
7 changes: 0 additions & 7 deletions src/Contracts/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 256,6 @@ public function getSimulatedResponsePayload(): ?SimulatedResponsePayload;
*/
public function getSenderException(): ?Throwable;

/**
* Get the raw response
*
* @return mixed
*/
public function getRawResponse(): mixed;

/**
* Get the body of the response.
*
Expand Down
5 changes: 3 additions & 2 deletions src/Data/Pipe.php
Original file line number Diff line number Diff line change
@@ -1,5 1,7 @@
<?php

declare(strict_types=1);

namespace Saloon\Data;

class Pipe
Expand All @@ -13,8 15,7 @@ class Pipe
public function __construct(
readonly public mixed $callable,
readonly public ?string $name = null,
)
{
) {
//
}
}
4 changes: 2 additions & 2 deletions src/Helpers/Pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 4,9 @@

namespace Saloon\Helpers;

use Saloon\Contracts\Pipeline as PipelineContract;
use Saloon\Data\Pipe;
use Saloon\Exceptions\DuplicatePipeNameException;
use Saloon\Contracts\Pipeline as PipelineContract;

class Pipeline implements PipelineContract
{
Expand Down Expand Up @@ -87,6 87,6 @@ public function getPipes(): array
*/
protected function pipeExists(string $name): bool
{
return ! empty(array_filter($this->pipes, static fn(Pipe $pipe) => $pipe->name === $name));
return ! empty(array_filter($this->pipes, static fn (Pipe $pipe) => $pipe->name === $name));
Sammyjo20 marked this conversation as resolved.
Show resolved Hide resolved
}
}
1 change: 0 additions & 1 deletion src/Http/Faking/Fixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 8,6 @@
use Saloon\Helpers\MockConfig;
use Saloon\Data\RecordedResponse;
use Saloon\Exceptions\FixtureMissingException;
use Saloon\Exceptions\DirectoryNotFoundException;

class Fixture
{
Expand Down
10 changes: 0 additions & 10 deletions src/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 87,6 @@ public function getRequest(): Request
return $this->pendingRequest->getRequest();
}

/**
* Get the raw response
*
* @return mixed
*/
public function getRawResponse(): mixed
{
return $this->psrResponse;
}

/**
* Get the body of the response as string.
*
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/MockConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 2,13 @@

declare(strict_types=1);

use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter;
use Saloon\Helpers\MockConfig;
use League\Flysystem\Filesystem;
use Saloon\Http\Faking\MockClient;
use Saloon\Http\Faking\MockResponse;
use Saloon\Exceptions\FixtureMissingException;
use Saloon\Tests\Fixtures\Requests\UserRequest;
use League\Flysystem\Local\LocalFilesystemAdapter;

afterEach(function () {
MockConfig::setFixturePath('tests/Fixtures/Saloon');
Expand Down