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

RemoteStateResponse   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
 * RemoteStateResponse is used to send a set of blocks
13
 * to a remote peer
14
 *
15
 * Generated from protobuf message <code>gossip.RemoteStateResponse</code>
16
 */
17
class RemoteStateResponse extends \Google\Protobuf\Internal\Message
18
{
19
    /**
20
     * Generated from protobuf field <code>repeated .gossip.Payload payloads = 1;</code>
21
     */
22
    private $payloads;
23
24
    public function __construct() {
25
        \GPBMetadata\Gossip\Message::initOnce();
26
        parent::__construct();
27
    }
28
29
    /**
30
     * Generated from protobuf field <code>repeated .gossip.Payload payloads = 1;</code>
31
     * @return \Google\Protobuf\Internal\RepeatedField
32
     */
33
    public function getPayloads()
34
    {
35
        return $this->payloads;
36
    }
37
38
    /**
39
     * Generated from protobuf field <code>repeated .gossip.Payload payloads = 1;</code>
40
     * @param \Hyperledger\Fabric\Protos\Gossip\Payload[]|\Google\Protobuf\Internal\RepeatedField $var
41
     * @return $this
42
     */
43
    public function setPayloads($var)
44
    {
45
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Hyperledger\Fabric\Protos\Gossip\Payload::class);
46
        $this->payloads = $arr;
47
48
        return $this;
49
    }
50
51
}
52
53