Issues (115)

src/Resources/IsIncluded.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace VGirol\JsonApi\Resources;
4
5
use Illuminate\Http\Request;
6
7
trait IsIncluded
8
{
9
    /**
10
     * Transform the resource into an array used as included resource.
11
     *
12
     * @param Request $request
13
     *
14
     * @return array
15
     */
16
    public function asIncluded($request): array
17
    {
18
        $data = $this->toArray($request);
0 ignored issues
show
It seems like toArray() 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

18
        /** @scrutinizer ignore-call */ 
19
        $data = $this->toArray($request);
Loading history...
19
20
        return array_merge_recursive($data, $this->additional);
21
    }
22
}
23