Passed
Push — master ( 8bc3a9...d5f8d6 )
by Christoffer
02:14
created

JsonEncodeArrayTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toJSON() 0 3 1
1
<?php
2
3
namespace Digia\GraphQL\Util;
4
5
trait JsonEncodeArrayTrait
6
{
7
    /**
8
     * @return array
9
     */
10
    abstract public function toArray(): array;
11
12
    /**
13
     * @return string
14
     */
15
    public function toJSON(): string
16
    {
17
        return json_encode($this->toArray(), JSON_UNESCAPED_UNICODE);
18
    }
19
}
20