SafeReferenceSerializer   A
last analyzed

Coupling/Cohesion

Components 0
Dependencies 1

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A serialize() 0 4 1
1
<?php
2
3
namespace League\JsonReference\ReferenceSerializer;
4
5
use League\JsonReference\Reference;
6
use League\JsonReference\ReferenceSerializerInterface;
7
8
/**
9
 * A reference serializer that returns the original reference.
10
 */
11
final class SafeReferenceSerializer implements ReferenceSerializerInterface
12
{
13 8
    public function serialize(Reference $reference)
14
    {
15 8
        return ['$ref' => $reference->getRef()];
16
    }
17
}
18