| 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 KafkaMessageRegular extends \Google\Protobuf\Internal\Message |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Generated from protobuf field <code>bytes payload = 1;</code> |
||
| 20 | */ |
||
| 21 | private $payload = ''; |
||
| 22 | |||
| 23 | public function __construct() { |
||
| 24 | \GPBMetadata\Orderer\Kafka::initOnce(); |
||
| 25 | parent::__construct(); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Generated from protobuf field <code>bytes payload = 1;</code> |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | public function getPayload() |
||
| 33 | { |
||
| 34 | return $this->payload; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Generated from protobuf field <code>bytes payload = 1;</code> |
||
| 39 | * @param string $var |
||
| 40 | * @return $this |
||
| 41 | */ |
||
| 42 | public function setPayload($var) |
||
| 43 | { |
||
| 44 | GPBUtil::checkString($var, False); |
||
| 45 | $this->payload = $var; |
||
| 46 | |||
| 47 | return $this; |
||
| 48 | } |
||
| 52 |