SerialiserVarUserId   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A serialise() 0 6 1
1
<?php
2
/**
3
 * This file is part of graze/unicontroller-client.
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/unicontroller-client/blob/master/LICENSE.md
11
 * @link https://github.com/graze/unicontroller-client
12
 */
13
namespace Graze\UnicontrollerClient\Serialiser\Serialiser;
14
15
use Graze\UnicontrollerClient\Serialiser\Serialiser\AbstractSerialiser;
16
use Graze\UnicontrollerClient\Serialiser\Serialiser\SerialiserInterface;
17
use Graze\UnicontrollerClient\Entity\Entity\EntityInterface;
18
19
class SerialiserVarUserId extends AbstractSerialiser implements SerialiserInterface
20
{
21
    /**
22
     * @param EntityInterface $entity
23
     * @return string
24
     */
25 1
    public function serialise(EntityInterface $entity)
26
    {
27 1
        $properties = [];
28 1
        $properties[] = $this->stringEscaper->escape($entity->getName());
0 ignored issues
show
Bug introduced by
The method getName() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of said class. However, the method does not exist in Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...tity\EntitySettingsById or Graze\UnicontrollerClien...ntity\EntityBarcodeItem or Graze\UnicontrollerClien...ty\Entity\EntityBoxItem or Graze\UnicontrollerClien...ntity\EntityPictureItem or Graze\UnicontrollerClien...y\Entity\EntityLineItem or Graze\UnicontrollerClien...y\EntityShiftDefinition or Graze\UnicontrollerClien...ty\Entity\EntityGeneric. Are you sure you never get one of those? ( Ignorable by Annotation )

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

28
        $properties[] = $this->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getName());
Loading history...
29
30 1
        return implode(',', $properties);
31
    }
32
}
33