adam-paterson /
ibm-watson-sdk
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace IBM\Watson\Common; |
||
| 6 | |||
| 7 | use Http\Message\RequestFactory; |
||
| 8 | use IBM\Watson\Common\Util\DiscoveryTrait; |
||
| 9 | use Psr\Http\Message\RequestInterface; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * RequestBuilder is a wrapper for a message factory to create PSR-7 requests. |
||
| 13 | */ |
||
| 14 | class RequestBuilder implements RequestBuilderInterface |
||
| 15 | { |
||
| 16 | use DiscoveryTrait; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var \Http\Message\RequestFactory |
||
| 20 | */ |
||
| 21 | private $requestFactory; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param \Http\Message\RequestFactory $requestFactory Request factory to create requests. |
||
| 25 | */ |
||
| 26 | public function __construct(RequestFactory $requestFactory = null) |
||
| 27 | { |
||
| 28 | $this->requestFactory = $requestFactory ?: $this->discoverMessageFactory(); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Create a PSR-7 request. |
||
| 33 | * |
||
| 34 | * @param string $method HTTP method type. |
||
| 35 | * @param string|UriInterface $uri Request path. |
||
|
0 ignored issues
–
show
|
|||
| 36 | * @param array $headers Request headers. |
||
| 37 | * @param resource|string|StreamInterface|null $body Request body. |
||
|
0 ignored issues
–
show
The type
IBM\Watson\Common\StreamInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 38 | * |
||
| 39 | * @return \Psr\Http\Message\RequestInterface |
||
| 40 | */ |
||
| 41 | public function create(string $method, $uri, array $headers = [], $body = null): RequestInterface |
||
| 42 | { |
||
| 43 | return $this->requestFactory->createRequest($method, $uri, $headers, $body); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths