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

BinaryDataSerialiser::serialise()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
ccs 5
cts 5
cp 1
cc 1
eloc 5
nc 1
nop 1
crap 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