Skip to content

Commit f128405

Browse files
committed
Remove vendor lock from pipeline
1 parent 67670d5 commit f128405

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Response.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Ivan770\HttpClient\Exceptions\PipelineNotAvailable;
66
use Symfony\Component\HttpClient\Exception\JsonException;
77
use Illuminate\Container\Container;
8+
use Illuminate\Contracts\Pipeline\Pipeline as PipelineContract;
89
use Illuminate\Pipeline\Pipeline;
910

1011
/**
@@ -28,7 +29,6 @@ public function __construct($baseResponse)
2829

2930
protected function pipelineAvailable()
3031
{
31-
//TODO: Remove pipeline vendor lock.
3232
if (class_exists(Pipeline::class)) {
3333
return true;
3434
}
@@ -45,7 +45,10 @@ protected function getContainer()
4545

4646
protected function getPipeline()
4747
{
48-
if ($this->pipelineAvailable() && is_null($this->pipeline)) {
48+
if ($this->getContainer()->bound(PipelineContract::class)) {
49+
$this->pipeline = $this->getContainer()->make(PipelineContract::class);
50+
}
51+
if (is_null($this->pipeline) && $this->pipelineAvailable()) {
4952
$this->pipeline = new Pipeline($this->getContainer());
5053
}
5154
return $this->pipeline;

0 commit comments

Comments
 (0)