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

ConfigGroupSchema   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 84
Duplicated Lines 23.81 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 20
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: common/configtx.proto
4
5
namespace Hyperledger\Fabric\Protos\Common;
6
7
use Google\Protobuf\Internal\GPBType;
8
use Google\Protobuf\Internal\RepeatedField;
9
use Google\Protobuf\Internal\GPBUtil;
10
11
/**
12
 * Generated from protobuf message <code>common.ConfigGroupSchema</code>
13
 */
14
class ConfigGroupSchema extends \Google\Protobuf\Internal\Message
15
{
16
    /**
17
     * Generated from protobuf field <code>map<string, .common.ConfigGroupSchema> groups = 1;</code>
18
     */
19
    private $groups;
20
    /**
21
     * Generated from protobuf field <code>map<string, .common.ConfigValueSchema> values = 2;</code>
22
     */
23
    private $values;
24
    /**
25
     * Generated from protobuf field <code>map<string, .common.ConfigPolicySchema> policies = 3;</code>
26
     */
27
    private $policies;
28
29
    public function __construct() {
30
        \GPBMetadata\Common\Configtx::initOnce();
31
        parent::__construct();
32
    }
33
34
    /**
35
     * Generated from protobuf field <code>map<string, .common.ConfigGroupSchema> groups = 1;</code>
36
     * @return \Google\Protobuf\Internal\MapField
37
     */
38
    public function getGroups()
39
    {
40
        return $this->groups;
41
    }
42
43
    /**
44
     * Generated from protobuf field <code>map<string, .common.ConfigGroupSchema> groups = 1;</code>
45
     * @param array|\Google\Protobuf\Internal\MapField $var
46
     * @return $this
47
     */
48
    public function setGroups($var)
49
    {
50
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Hyperledger\Fabric\Protos\Common\ConfigGroupSchema::class);
51
        $this->groups = $arr;
52
53
        return $this;
54
    }
55
56
    /**
57
     * Generated from protobuf field <code>map<string, .common.ConfigValueSchema> values = 2;</code>
58
     * @return \Google\Protobuf\Internal\MapField
59
     */
60
    public function getValues()
61
    {
62
        return $this->values;
63
    }
64
65
    /**
66
     * Generated from protobuf field <code>map<string, .common.ConfigValueSchema> values = 2;</code>
67
     * @param array|\Google\Protobuf\Internal\MapField $var
68
     * @return $this
69
     */
70
    public function setValues($var)
71
    {
72
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Hyperledger\Fabric\Protos\Common\ConfigValueSchema::class);
73
        $this->values = $arr;
74
75
        return $this;
76
    }
77
78
    /**
79
     * Generated from protobuf field <code>map<string, .common.ConfigPolicySchema> policies = 3;</code>
80
     * @return \Google\Protobuf\Internal\MapField
81
     */
82
    public function getPolicies()
83
    {
84
        return $this->policies;
85
    }
86
87
    /**
88
     * Generated from protobuf field <code>map<string, .common.ConfigPolicySchema> policies = 3;</code>
89
     * @param array|\Google\Protobuf\Internal\MapField $var
90
     * @return $this
91
     */
92
    public function setPolicies($var)
93
    {
94
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Hyperledger\Fabric\Protos\Common\ConfigPolicySchema::class);
95
        $this->policies = $arr;
96
97
        return $this;
98
    }
99
100
}
101
102