SerialiserBarcodeItem::serialise()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 30
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 28
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 27
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 30
ccs 28
cts 28
cp 1
crap 1
rs 9.488
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 SerialiserBarcodeItem extends AbstractSerialiser implements SerialiserInterface
20
{
21
    /**
22
     * @param EntityInterface $entity
23
     * @return string
24
     */
25 2
    public function serialise(EntityInterface $entity)
26
    {
27 2
        $properties = [];
28 2
        $properties[] = $entity->getAnchorPoint();
0 ignored issues
show
Bug introduced by
The method getAnchorPoint() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem or Graze\UnicontrollerClien...ty\Entity\EntityBoxItem or Graze\UnicontrollerClien...ntity\EntityPictureItem or Graze\UnicontrollerClien...y\Entity\EntityLineItem. ( Ignorable by Annotation )

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

28
        /** @scrutinizer ignore-call */ 
29
        $properties[] = $entity->getAnchorPoint();
Loading history...
29 2
        $properties[] = $entity->getXPos();
0 ignored issues
show
Bug introduced by
The method getXPos() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem or Graze\UnicontrollerClien...ty\Entity\EntityBoxItem or Graze\UnicontrollerClien...ntity\EntityPictureItem or Graze\UnicontrollerClien...y\Entity\EntityLineItem. ( Ignorable by Annotation )

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

29
        /** @scrutinizer ignore-call */ 
30
        $properties[] = $entity->getXPos();
Loading history...
30 2
        $properties[] = $entity->getYPos();
0 ignored issues
show
Bug introduced by
The method getYPos() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem or Graze\UnicontrollerClien...ty\Entity\EntityBoxItem or Graze\UnicontrollerClien...ntity\EntityPictureItem or Graze\UnicontrollerClien...y\Entity\EntityLineItem. ( Ignorable by Annotation )

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

30
        /** @scrutinizer ignore-call */ 
31
        $properties[] = $entity->getYPos();
Loading history...
31 2
        $properties[] = $entity->getHeight();
0 ignored issues
show
Bug introduced by
The method getHeight() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem or Graze\UnicontrollerClien...ty\Entity\EntityBoxItem or Graze\UnicontrollerClien...Entity\EntityReadDesign or Graze\UnicontrollerClien...ntity\EntityPictureItem or Graze\UnicontrollerClien...y\Entity\EntityLineItem. ( Ignorable by Annotation )

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

31
        /** @scrutinizer ignore-call */ 
32
        $properties[] = $entity->getHeight();
Loading history...
32 2
        $properties[] = $entity->getOrion();
0 ignored issues
show
Bug introduced by
The method getOrion() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem or Graze\UnicontrollerClien...ty\Entity\EntityBoxItem or Graze\UnicontrollerClien...ntity\EntityPictureItem or Graze\UnicontrollerClien...y\Entity\EntityLineItem. ( Ignorable by Annotation )

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

32
        /** @scrutinizer ignore-call */ 
33
        $properties[] = $entity->getOrion();
Loading history...
33 2
        $properties[] = $this->stringEscaper->escape($entity->getDescription());
0 ignored issues
show
Bug introduced by
The method getDescription() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem or Graze\UnicontrollerClien...ty\Entity\EntityBoxItem or Graze\UnicontrollerClien...ntity\EntityPictureItem or Graze\UnicontrollerClien...y\Entity\EntityLineItem. ( Ignorable by Annotation )

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

33
        $properties[] = $this->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getDescription());
Loading history...
34 2
        $properties[] = $entity->getNarrow();
0 ignored issues
show
Bug introduced by
The method getNarrow() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

34
        /** @scrutinizer ignore-call */ 
35
        $properties[] = $entity->getNarrow();
Loading history...
35 2
        $properties[] = $entity->getInverted();
0 ignored issues
show
Bug introduced by
The method getInverted() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

35
        /** @scrutinizer ignore-call */ 
36
        $properties[] = $entity->getInverted();
Loading history...
36 2
        $properties[] = $entity->getBarcodeType();
0 ignored issues
show
Bug introduced by
The method getBarcodeType() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

36
        /** @scrutinizer ignore-call */ 
37
        $properties[] = $entity->getBarcodeType();
Loading history...
37 2
        $properties[] = $this->stringEscaper->escape($entity->getData());
0 ignored issues
show
Bug introduced by
The method getData() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

37
        $properties[] = $this->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getData());
Loading history...
38 2
        $properties[] = $entity->getHumanReadable();
0 ignored issues
show
Bug introduced by
The method getHumanReadable() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

38
        /** @scrutinizer ignore-call */ 
39
        $properties[] = $entity->getHumanReadable();
Loading history...
39 2
        $properties[] = $entity->getRatio();
0 ignored issues
show
Bug introduced by
The method getRatio() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

39
        /** @scrutinizer ignore-call */ 
40
        $properties[] = $entity->getRatio();
Loading history...
40 2
        $properties[] = $entity->getFrame();
0 ignored issues
show
Bug introduced by
The method getFrame() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

40
        /** @scrutinizer ignore-call */ 
41
        $properties[] = $entity->getFrame();
Loading history...
41 2
        $properties[] = $entity->getShowDropDowns();
0 ignored issues
show
Bug introduced by
The method getShowDropDowns() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

41
        /** @scrutinizer ignore-call */ 
42
        $properties[] = $entity->getShowDropDowns();
Loading history...
42 2
        $properties[] = $this->stringEscaper->escape($entity->getFontName());
0 ignored issues
show
Bug introduced by
The method getFontName() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

42
        $properties[] = $this->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getFontName());
Loading history...
43 2
        $properties[] = $entity->getPointSize();
0 ignored issues
show
Bug introduced by
The method getPointSize() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

43
        /** @scrutinizer ignore-call */ 
44
        $properties[] = $entity->getPointSize();
Loading history...
44 2
        $properties[] = $entity->getBold();
0 ignored issues
show
Bug introduced by
The method getBold() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

44
        /** @scrutinizer ignore-call */ 
45
        $properties[] = $entity->getBold();
Loading history...
45 2
        $properties[] = $entity->getItalic();
0 ignored issues
show
Bug introduced by
The method getItalic() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

45
        /** @scrutinizer ignore-call */ 
46
        $properties[] = $entity->getItalic();
Loading history...
46 2
        $properties[] = $entity->getSubType();
0 ignored issues
show
Bug introduced by
The method getSubType() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

46
        /** @scrutinizer ignore-call */ 
47
        $properties[] = $entity->getSubType();
Loading history...
47 2
        $properties[] = $entity->getPreferredFormat();
0 ignored issues
show
Bug introduced by
The method getPreferredFormat() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

47
        /** @scrutinizer ignore-call */ 
48
        $properties[] = $entity->getPreferredFormat();
Loading history...
48 2
        $properties[] = $entity->getProcessTilde();
0 ignored issues
show
Bug introduced by
The method getProcessTilde() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

48
        /** @scrutinizer ignore-call */ 
49
        $properties[] = $entity->getProcessTilde();
Loading history...
49 2
        $properties[] = $entity->getSeparatorHeight();
0 ignored issues
show
Bug introduced by
The method getSeparatorHeight() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

49
        /** @scrutinizer ignore-call */ 
50
        $properties[] = $entity->getSeparatorHeight();
Loading history...
50 2
        $properties[] = $entity->getSegmentWidth();
0 ignored issues
show
Bug introduced by
The method getSegmentWidth() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

50
        /** @scrutinizer ignore-call */ 
51
        $properties[] = $entity->getSegmentWidth();
Loading history...
51 2
        $properties[] = $entity->getUseHibc();
0 ignored issues
show
Bug introduced by
The method getUseHibc() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ntity\EntityBarcodeItem. ( Ignorable by Annotation )

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

51
        /** @scrutinizer ignore-call */ 
52
        $properties[] = $entity->getUseHibc();
Loading history...
52 2
        $properties[] = $entity->getPhantomField();
0 ignored issues
show
Bug introduced by
The method getPhantomField() does not exist on Graze\UnicontrollerClien...\Entity\EntityInterface. It seems like you code against a sub-type of Graze\UnicontrollerClien...\Entity\EntityInterface such as Graze\UnicontrollerClien...ty\Entity\EntityTtfItem or Graze\UnicontrollerClien...ntity\EntityBarcodeItem or Graze\UnicontrollerClien...ty\Entity\EntityBoxItem or Graze\UnicontrollerClien...ntity\EntityPictureItem or Graze\UnicontrollerClien...y\Entity\EntityLineItem. ( Ignorable by Annotation )

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

52
        /** @scrutinizer ignore-call */ 
53
        $properties[] = $entity->getPhantomField();
Loading history...
53
54 2
        return implode(',', $properties);
55
    }
56
}
57