SerialiserVarDatabase   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A serialise() 0 27 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 SerialiserVarDatabase 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[] = $this->stringEscaper->escape($entity->getDataSource());
0 ignored issues
show
Bug introduced by
The method getDataSource() 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\EntityVarDatabase or Graze\UnicontrollerClien...\EntityVarDatabaseField or Graze\UnicontrollerClien...ity\Entity\EntityVarRtc. ( Ignorable by Annotation )

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

29
        $properties[] = $this->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getDataSource());
Loading history...
30 1
        $properties[] = $this->stringEscaper->escape($entity->getRefFileName());
0 ignored issues
show
Bug introduced by
The method getRefFileName() 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\EntityVarDatabase. ( Ignorable by Annotation )

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

30
        $properties[] = $this->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getRefFileName());
Loading history...
31 1
        $properties[] = $this->stringEscaper->escape($entity->getTable());
0 ignored issues
show
Bug introduced by
The method getTable() 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\EntityVarDatabase. ( Ignorable by Annotation )

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

31
        $properties[] = $this->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getTable());
Loading history...
32 1
        $properties[] = $this->stringEscaper->escape($entity->getKeyField());
0 ignored issues
show
Bug introduced by
The method getKeyField() 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\EntityVarDatabase. ( Ignorable by Annotation )

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

32
        $properties[] = $this->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getKeyField());
Loading history...
33 1
        $properties[] = $this->stringEscaper->escape($entity->getDataField());
0 ignored issues
show
Bug introduced by
The method getDataField() 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\EntityVarDatabase or Graze\UnicontrollerClien...\EntityVarDatabaseField. ( 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 */ getDataField());
Loading history...
34 1
        $properties[] = $this->stringEscaper->escape($entity->getPrompt());
0 ignored issues
show
Bug introduced by
The method getPrompt() 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\EntityVarPrompt or Graze\UnicontrollerClien...ity\Entity\EntityVarSeq or Graze\UnicontrollerClien...ntity\EntityVarDatabase. ( Ignorable by Annotation )

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

34
        $properties[] = $this->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getPrompt());
Loading history...
35 1
        $properties[] = $entity->getDisplayLength();
0 ignored issues
show
Bug introduced by
The method getDisplayLength() 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\EntityVarDatabase or Graze\UnicontrollerClien...\EntityVarDatabaseField. ( 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->getDisplayLength();
Loading history...
36 1
        $properties[] = $entity->getTrimTrailingSpaces();
0 ignored issues
show
Bug introduced by
The method getTrimTrailingSpaces() 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\EntityVarDatabase or Graze\UnicontrollerClien...\EntityVarDatabaseField. ( 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->getTrimTrailingSpaces();
Loading history...
37 1
        $properties[] = $entity->getPrintAll();
0 ignored issues
show
Bug introduced by
The method getPrintAll() 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\EntityVarDatabase. ( 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->getPrintAll();
Loading history...
38 1
        $properties[] = $entity->getFixedKey();
0 ignored issues
show
Bug introduced by
The method getFixedKey() 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\EntityVarDatabase. ( 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->getFixedKey();
Loading history...
39 1
        $properties[] = $entity->getSingleData();
0 ignored issues
show
Bug introduced by
The method getSingleData() 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\EntityVarDatabase. ( 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->getSingleData();
Loading history...
40 1
        $properties[] = $entity->getUsePrompt();
0 ignored issues
show
Bug introduced by
The method getUsePrompt() 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\EntityVarDatabase. ( 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->getUsePrompt();
Loading history...
41 1
        $properties[] = $this->stringEscaper->escape($entity->getKeyData());
0 ignored issues
show
Bug introduced by
The method getKeyData() 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\EntityVarDatabase. ( 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->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getKeyData());
Loading history...
42 1
        $properties[] = $this->stringEscaper->escape($entity->getFixedKeyData());
0 ignored issues
show
Bug introduced by
The method getFixedKeyData() 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\EntityVarDatabase. ( 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 */ getFixedKeyData());
Loading history...
43 1
        $properties[] = $this->stringEscaper->escape($entity->getCodePage());
0 ignored issues
show
Bug introduced by
The method getCodePage() 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\EntityVarDatabase. ( 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->stringEscaper->escape($entity->/** @scrutinizer ignore-call */ getCodePage());
Loading history...
44 1
        $properties[] = $entity->getNumberOfDecimals();
0 ignored issues
show
Bug introduced by
The method getNumberOfDecimals() 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\EntityVarDatabase or Graze\UnicontrollerClien...\EntityVarDatabaseField. ( 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->getNumberOfDecimals();
Loading history...
45 1
        $properties[] = $entity->getRunSequence();
0 ignored issues
show
Bug introduced by
The method getRunSequence() 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\EntityVarDatabase. ( 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->getRunSequence();
Loading history...
46 1
        $properties[] = $entity->getActionWhenDone();
0 ignored issues
show
Bug introduced by
The method getActionWhenDone() 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\EntityVarDatabase. ( 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->getActionWhenDone();
Loading history...
47 1
        $properties[] = $entity->getrawBaseData();
0 ignored issues
show
Bug introduced by
The method getrawBaseData() 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\EntityVarDatabase. ( 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->getrawBaseData();
Loading history...
48 1
        $properties[] = $entity->getDatabaseType();
0 ignored issues
show
Bug introduced by
The method getDatabaseType() 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\EntityVarDatabase. ( 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->getDatabaseType();
Loading history...
49 1
        $properties[] = $entity->getcPadding();
0 ignored issues
show
Bug introduced by
The method getcPadding() 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...tity\EntityVarShiftCode or Graze\UnicontrollerClien...ty\EntityVarMacroOutput or Graze\UnicontrollerClien...\Entity\EntityVarPrompt or Graze\UnicontrollerClien...ntity\EntityVarDatabase or Graze\UnicontrollerClien...\Entity\EntityVarSerial or Graze\UnicontrollerClien...\EntityVarDatabaseField or Graze\UnicontrollerClien...ity\Entity\EntityVarRtc or Graze\UnicontrollerClien...y\Entity\EntityVarMacro. ( 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->getcPadding();
Loading history...
50
51 1
        return implode(',', $properties);
52
    }
53
}
54