Completed
Push — master ( 411d94...8fae9a )
by John
02:59
created

BinaryDataSerialiser   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A serialise() 0 8 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;
14
15
class BinaryDataSerialiser
16
{
17
    /**
18
     * @param string $binaryData
19
     * @return string
20
     */
21 3
    public function serialise($binaryData)
22
    {
23 3
        return sprintf(
24 3
            "BinaryData,%d,\r\n%s\r\nBinaryEnd",
25 3
            strlen($binaryData), // this is returning the number of bytes, but I think they want chars.
26
            $binaryData
27 3
        );
28
    }
29
}
30