| 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 |
||
| 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 | } |
||
| 53 |