BinaryDataSerialiser   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A serialise() 0 6 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