SerialiserReadDesign::serialise()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 32
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 30
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 29
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 32
ccs 30
cts 30
cp 1
crap 1
rs 9.456
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 SerialiserReadDesign 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 1
        $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

29
        /** @scrutinizer ignore-call */ 
30
        $properties[] = $entity->getHeight();
Loading history...
30 1
        $properties[] = $entity->getWidth();
0 ignored issues
show
Bug introduced by
The method getWidth() 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...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

30
        /** @scrutinizer ignore-call */ 
31
        $properties[] = $entity->getWidth();
Loading history...
31 1
        $properties[] = $entity->getStorageMode();
0 ignored issues
show
Bug introduced by
The method getStorageMode() 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...Entity\EntityReadDesign. ( 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->getStorageMode();
Loading history...
32 1
        $properties[] = $entity->getSaveDesign();
0 ignored issues
show
Bug introduced by
The method getSaveDesign() 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...Entity\EntityReadDesign. ( 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->getSaveDesign();
Loading history...
33 1
        $properties[] = $entity->getPrintDesign();
0 ignored issues
show
Bug introduced by
The method getPrintDesign() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

33
        /** @scrutinizer ignore-call */ 
34
        $properties[] = $entity->getPrintDesign();
Loading history...
34 1
        $properties[] = $entity->getDriverId();
0 ignored issues
show
Bug introduced by
The method getDriverId() 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...Entity\EntityReadDesign. ( 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->getDriverId();
Loading history...
35 1
        $properties[] = $entity->getPrintCount();
0 ignored issues
show
Bug introduced by
The method getPrintCount() 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...Entity\EntityReadDesign. ( 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->getPrintCount();
Loading history...
36 1
        $properties[] = $entity->getCycleSize();
0 ignored issues
show
Bug introduced by
The method getCycleSize() 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...Entity\EntityReadDesign. ( 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->getCycleSize();
Loading history...
37 1
        $properties[] = $entity->getReadOk();
0 ignored issues
show
Bug introduced by
The method getReadOk() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

37
        /** @scrutinizer ignore-call */ 
38
        $properties[] = $entity->getReadOk();
Loading history...
38 1
        $properties[] = $this->arraySerialiser->serialise($entity->getLineArray(), 'LineItem');
0 ignored issues
show
Bug introduced by
The method getLineArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

38
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getLineArray(), 'LineItem');
Loading history...
39 1
        $properties[] = $this->arraySerialiser->serialise($entity->getBoxArray(), 'BoxItem');
0 ignored issues
show
Bug introduced by
The method getBoxArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

39
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getBoxArray(), 'BoxItem');
Loading history...
40 1
        $properties[] = $this->arraySerialiser->serialise($entity->getTtfArray(), 'TtfItem');
0 ignored issues
show
Bug introduced by
The method getTtfArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

40
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getTtfArray(), 'TtfItem');
Loading history...
41 1
        $properties[] = $this->arraySerialiser->serialise($entity->getBarcodeArray(), 'BarcodeItem');
0 ignored issues
show
Bug introduced by
The method getBarcodeArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

41
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getBarcodeArray(), 'BarcodeItem');
Loading history...
42 1
        $properties[] = $this->arraySerialiser->serialise($entity->getPictureArray(), 'PictureItem');
0 ignored issues
show
Bug introduced by
The method getPictureArray() 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...Entity\EntityReadDesign. ( 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->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getPictureArray(), 'PictureItem');
Loading history...
43 1
        $properties[] = $this->arraySerialiser->serialise($entity->getPromptArray(), 'VarPrompt');
0 ignored issues
show
Bug introduced by
The method getPromptArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

43
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getPromptArray(), 'VarPrompt');
Loading history...
44 1
        $properties[] = $this->arraySerialiser->serialise($entity->getSeqArray(), 'VarSeq');
0 ignored issues
show
Bug introduced by
The method getSeqArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

44
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getSeqArray(), 'VarSeq');
Loading history...
45 1
        $properties[] = $this->arraySerialiser->serialise($entity->getRtcArray(), 'VarRtc');
0 ignored issues
show
Bug introduced by
The method getRtcArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

45
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getRtcArray(), 'VarRtc');
Loading history...
46 1
        $properties[] = $this->arraySerialiser->serialise($entity->getDatabaseArray(), 'VarDatabase');
0 ignored issues
show
Bug introduced by
The method getDatabaseArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

46
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getDatabaseArray(), 'VarDatabase');
Loading history...
47 1
        $properties[] = $this->arraySerialiser->serialise($entity->getUserIdArray(), 'VarUserId');
0 ignored issues
show
Bug introduced by
The method getUserIdArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

47
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getUserIdArray(), 'VarUserId');
Loading history...
48 1
        $properties[] = $this->arraySerialiser->serialise($entity->getShiftCodeArray(), 'VarShiftCode');
0 ignored issues
show
Bug introduced by
The method getShiftCodeArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

48
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getShiftCodeArray(), 'VarShiftCode');
Loading history...
49 1
        $properties[] = $this->arraySerialiser->serialise($entity->getMachineIdArray(), 'VarMachineId');
0 ignored issues
show
Bug introduced by
The method getMachineIdArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

49
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getMachineIdArray(), 'VarMachineId');
Loading history...
50 1
        $properties[] = $this->arraySerialiser->serialise($entity->getDatabaseFieldArray(), 'VarDatabaseField');
0 ignored issues
show
Bug introduced by
The method getDatabaseFieldArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

50
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getDatabaseFieldArray(), 'VarDatabaseField');
Loading history...
51 1
        $properties[] = $this->arraySerialiser->serialise($entity->getMacroArray(), 'VarMacro');
0 ignored issues
show
Bug introduced by
The method getMacroArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

51
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getMacroArray(), 'VarMacro');
Loading history...
52 1
        $properties[] = $this->arraySerialiser->serialise($entity->getMacroOutputArray(), 'VarMacroOutput');
0 ignored issues
show
Bug introduced by
The method getMacroOutputArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

52
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getMacroOutputArray(), 'VarMacroOutput');
Loading history...
53 1
        $properties[] = $this->arraySerialiser->serialise($entity->getSerialVarArray(), 'VarSerial');
0 ignored issues
show
Bug introduced by
The method getSerialVarArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

53
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getSerialVarArray(), 'VarSerial');
Loading history...
54 1
        $properties[] = $this->arraySerialiser->serialise($entity->getSettingsArray(), 'SettingsById');
0 ignored issues
show
Bug introduced by
The method getSettingsArray() 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...Entity\EntityReadDesign. ( Ignorable by Annotation )

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

54
        $properties[] = $this->arraySerialiser->serialise($entity->/** @scrutinizer ignore-call */ getSettingsArray(), 'SettingsById');
Loading history...
55
56 1
        return implode(',', $properties);
57
    }
58
}
59