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

LeadershipMessage   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 84
Duplicated Lines 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 84
loc 84
rs 10
wmc 7

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
 * Leadership Message is sent during leader election to inform
13
 * remote peers about intent of peer to proclaim itself as leader
14
 *
15
 * Generated from protobuf message <code>gossip.LeadershipMessage</code>
16
 */
17
class LeadershipMessage extends \Google\Protobuf\Internal\Message
18
{
19
    /**
20
     * Generated from protobuf field <code>bytes pki_id = 1;</code>
21
     */
22
    private $pki_id = '';
23
    /**
24
     * Generated from protobuf field <code>.gossip.PeerTime timestamp = 2;</code>
25
     */
26
    private $timestamp = null;
27
    /**
28
     * Generated from protobuf field <code>bool is_declaration = 3;</code>
29
     */
30
    private $is_declaration = false;
31
32
    public function __construct() {
33
        \GPBMetadata\Gossip\Message::initOnce();
34
        parent::__construct();
35
    }
36
37
    /**
38
     * Generated from protobuf field <code>bytes pki_id = 1;</code>
39
     * @return string
40
     */
41
    public function getPkiId()
42
    {
43
        return $this->pki_id;
44
    }
45
46
    /**
47
     * Generated from protobuf field <code>bytes pki_id = 1;</code>
48
     * @param string $var
49
     * @return $this
50
     */
51
    public function setPkiId($var)
52
    {
53
        GPBUtil::checkString($var, False);
54
        $this->pki_id = $var;
55
56
        return $this;
57
    }
58
59
    /**
60
     * Generated from protobuf field <code>.gossip.PeerTime timestamp = 2;</code>
61
     * @return \Hyperledger\Fabric\Protos\Gossip\PeerTime
62
     */
63
    public function getTimestamp()
64
    {
65
        return $this->timestamp;
66
    }
67
68
    /**
69
     * Generated from protobuf field <code>.gossip.PeerTime timestamp = 2;</code>
70
     * @param \Hyperledger\Fabric\Protos\Gossip\PeerTime $var
71
     * @return $this
72
     */
73
    public function setTimestamp($var)
74
    {
75
        GPBUtil::checkMessage($var, \Hyperledger\Fabric\Protos\Gossip\PeerTime::class);
76
        $this->timestamp = $var;
77
78
        return $this;
79
    }
80
81
    /**
82
     * Generated from protobuf field <code>bool is_declaration = 3;</code>
83
     * @return bool
84
     */
85
    public function getIsDeclaration()
86
    {
87
        return $this->is_declaration;
88
    }
89
90
    /**
91
     * Generated from protobuf field <code>bool is_declaration = 3;</code>
92
     * @param bool $var
93
     * @return $this
94
     */
95
    public function setIsDeclaration($var)
96
    {
97
        GPBUtil::checkBool($var);
98
        $this->is_declaration = $var;
99
100
        return $this;
101
    }
102
103
}
104
105