Code Duplication    Length = 16-16 lines in 5 locations

src/MetadataV3/mapping/cs/TComplexTypeMappingType.php 3 locations

@@ 146-161 (lines=16) @@
143
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TScalarPropertyType[] $scalarProperty
144
     * @return self
145
     */
146
    public function setScalarProperty(array $scalarProperty)
147
    {
148
        $msg = null;
149
        // if other arrays are empty, then the array we're assigning must not be empty
150
        $count = count($this->complexProperty) + count($this->condition);
151
        if (!$this->isValidArrayOK(
152
            $scalarProperty,
153
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TScalarPropertyType',
154
            $msg,
155
            0 < $count ? 0 : 1
156
        )) {
157
            throw new \InvalidArgumentException($msg);
158
        }
159
        $this->scalarProperty = $scalarProperty;
160
        return $this;
161
    }
162
163
    /**
164
     * Adds as complexProperty
@@ 217-232 (lines=16) @@
214
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TComplexPropertyType[] $complexProperty
215
     * @return self
216
     */
217
    public function setComplexProperty(array $complexProperty)
218
    {
219
        $msg = null;
220
        // if other arrays are empty, then the array we're assigning must not be empty
221
        $count = count($this->scalarProperty) + count($this->condition);
222
        if (!$this->isValidArrayOK(
223
            $complexProperty,
224
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TComplexPropertyType',
225
            $msg,
226
            0 < $count ? 0 : 1
227
        )) {
228
            throw new \InvalidArgumentException($msg);
229
        }
230
        $this->complexProperty = $complexProperty;
231
        return $this;
232
    }
233
234
    /**
235
     * Adds as condition
@@ 288-303 (lines=16) @@
285
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TConditionType[] $condition
286
     * @return self
287
     */
288
    public function setCondition(array $condition)
289
    {
290
        $msg = null;
291
        // if other arrays are empty, then the array we're assigning must not be empty
292
        $count = count($this->scalarProperty) + count($this->complexProperty);
293
        if (!$this->isValidArrayOK(
294
            $condition,
295
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TConditionType',
296
            $msg,
297
            0 < $count ? 0 : 1
298
        )) {
299
            throw new \InvalidArgumentException($msg);
300
        }
301
        $this->condition = $condition;
302
        return $this;
303
    }
304
305
    public function isOK(&$msg = null)
306
    {

src/MetadataV3/mapping/cs/TFunctionImportEntityTypeMappingType.php 2 locations

@@ 112-127 (lines=16) @@
109
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TScalarPropertyType[] $scalarProperty
110
     * @return self
111
     */
112
    public function setScalarProperty(array $scalarProperty)
113
    {
114
        $msg = null;
115
        // if other arrays are empty, then the array we're assigning must not be empty
116
        $count = count($this->condition);
117
        if (!$this->isValidArrayOK(
118
            $scalarProperty,
119
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TScalarPropertyType',
120
            $msg,
121
            0 < $count ? 0 : 1
122
        )) {
123
            throw new \InvalidArgumentException($msg);
124
        }
125
        $this->scalarProperty = $scalarProperty;
126
        return $this;
127
    }
128
129
    /**
130
     * Adds as condition
@@ 183-198 (lines=16) @@
180
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TFunctionImportConditionType[] $condition
181
     * @return self
182
     */
183
    public function setCondition(array $condition)
184
    {
185
        $msg = null;
186
        // if other arrays are empty, then the array we're assigning must not be empty
187
        $count = count($this->scalarProperty);
188
        if (!$this->isValidArrayOK(
189
            $condition,
190
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TFunctionImportConditionType',
191
            $msg,
192
            0 < $count ? 0 : 1
193
        )) {
194
            throw new \InvalidArgumentException($msg);
195
        }
196
        $this->condition = $condition;
197
        return $this;
198
    }
199
200
    public function isOK(&$msg = null)
201
    {