Passed
Pull Request — master (#3)
by Timothy
06:14
created

DataMessage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 32
loc 32
rs 10
wmc 3

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
# Generated by the protocol buffer compiler.  DO NOT EDIT!
3
# source: gossip/message.proto
4
5
namespace Hyperledger\Fabric\Protos\Gossip;
6
7
use Google\Protobuf\Internal\GPBType;
8
use Google\Protobuf\Internal\RepeatedField;
9
use Google\Protobuf\Internal\GPBUtil;
10
11
/**
12
 * DataMessage is the message that contains a block
13
 *
14
 * Generated from protobuf message <code>gossip.DataMessage</code>
15
 */
16
class DataMessage extends \Google\Protobuf\Internal\Message
17
{
18
    /**
19
     * Generated from protobuf field <code>.gossip.Payload payload = 1;</code>
20
     */
21
    private $payload = null;
22
23
    public function __construct() {
24
        \GPBMetadata\Gossip\Message::initOnce();
25
        parent::__construct();
26
    }
27
28
    /**
29
     * Generated from protobuf field <code>.gossip.Payload payload = 1;</code>
30
     * @return \Hyperledger\Fabric\Protos\Gossip\Payload
31
     */
32
    public function getPayload()
33
    {
34
        return $this->payload;
35
    }
36
37
    /**
38
     * Generated from protobuf field <code>.gossip.Payload payload = 1;</code>
39
     * @param \Hyperledger\Fabric\Protos\Gossip\Payload $var
40
     * @return $this
41
     */
42
    public function setPayload($var)
43
    {
44
        GPBUtil::checkMessage($var, \Hyperledger\Fabric\Protos\Gossip\Payload::class);
45
        $this->payload = $var;
46
47
        return $this;
48
    }
49
50
}
51
52