Total Complexity | 3 |
Total Lines | 32 |
Duplicated Lines | 100 % |
Changes | 0 |
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 |
||
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 | } |
||
52 |