Issues (31)

src/Actions/Create.php (2 issues)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Swis\JsonApi\Client\Actions;
6
7
use Swis\JsonApi\Client\Interfaces\ItemInterface;
8
9
/**
10
 * @template TItem of \Swis\JsonApi\Client\Interfaces\ItemInterface
11
 */
12
trait Create
13
{
14
    /**
15
     * @return \Swis\JsonApi\Client\Interfaces\ItemDocumentInterface<TItem>
16
     */
17 4
    public function create(ItemInterface $item, array $parameters = [], array $headers = [])
18
    {
19 4
        return $this->getClient()->post(
0 ignored issues
show
It seems like getClient() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        return $this->/** @scrutinizer ignore-call */ getClient()->post(
Loading history...
20 4
            $this->getEndpoint().'?'.http_build_query($parameters),
0 ignored issues
show
It seems like getEndpoint() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
            $this->/** @scrutinizer ignore-call */ 
21
                   getEndpoint().'?'.http_build_query($parameters),
Loading history...
21 4
            $this->documentFactory->make($item),
22 2
            $headers,
23 2
        );
24
    }
25
}
26