Passed
Pull Request — master (#3)
by Timothy
11:06 queued 05:35
created

MembershipResponse   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 58
loc 58
rs 10
wmc 5

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
 * MembershipResponse is used for replying to MembershipRequests
13
 *
14
 * Generated from protobuf message <code>gossip.MembershipResponse</code>
15
 */
16
class MembershipResponse extends \Google\Protobuf\Internal\Message
17
{
18
    /**
19
     * Generated from protobuf field <code>repeated .gossip.Envelope alive = 1;</code>
20
     */
21
    private $alive;
22
    /**
23
     * Generated from protobuf field <code>repeated .gossip.Envelope dead = 2;</code>
24
     */
25
    private $dead;
26
27
    public function __construct() {
28
        \GPBMetadata\Gossip\Message::initOnce();
29
        parent::__construct();
30
    }
31
32
    /**
33
     * Generated from protobuf field <code>repeated .gossip.Envelope alive = 1;</code>
34
     * @return \Google\Protobuf\Internal\RepeatedField
35
     */
36
    public function getAlive()
37
    {
38
        return $this->alive;
39
    }
40
41
    /**
42
     * Generated from protobuf field <code>repeated .gossip.Envelope alive = 1;</code>
43
     * @param \Hyperledger\Fabric\Protos\Gossip\Envelope[]|\Google\Protobuf\Internal\RepeatedField $var
44
     * @return $this
45
     */
46
    public function setAlive($var)
47
    {
48
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Hyperledger\Fabric\Protos\Gossip\Envelope::class);
49
        $this->alive = $arr;
50
51
        return $this;
52
    }
53
54
    /**
55
     * Generated from protobuf field <code>repeated .gossip.Envelope dead = 2;</code>
56
     * @return \Google\Protobuf\Internal\RepeatedField
57
     */
58
    public function getDead()
59
    {
60
        return $this->dead;
61
    }
62
63
    /**
64
     * Generated from protobuf field <code>repeated .gossip.Envelope dead = 2;</code>
65
     * @param \Hyperledger\Fabric\Protos\Gossip\Envelope[]|\Google\Protobuf\Internal\RepeatedField $var
66
     * @return $this
67
     */
68
    public function setDead($var)
69
    {
70
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Hyperledger\Fabric\Protos\Gossip\Envelope::class);
71
        $this->dead = $arr;
72
73
        return $this;
74
    }
75
76
}
77
78