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
        ) {
158
            throw new \InvalidArgumentException($msg);
159
        }
160
        $this->scalarProperty = $scalarProperty;
161
        return $this;
162
    }
163
164
    /**
@@ 218-233 (lines=16) @@
215
     * @param  \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TComplexPropertyType[] $complexProperty
216
     * @return self
217
     */
218
    public function setComplexProperty(array $complexProperty)
219
    {
220
        $msg = null;
221
        // if other arrays are empty, then the array we're assigning must not be empty
222
        $count = count($this->scalarProperty) + count($this->condition);
223
        if (!$this->isValidArrayOK(
224
            $complexProperty,
225
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TComplexPropertyType',
226
            $msg,
227
            0 < $count ? 0 : 1
228
        )
229
        ) {
230
            throw new \InvalidArgumentException($msg);
231
        }
232
        $this->complexProperty = $complexProperty;
233
        return $this;
234
    }
235
236
    /**
@@ 290-305 (lines=16) @@
287
     * @param  \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TConditionType[] $condition
288
     * @return self
289
     */
290
    public function setCondition(array $condition)
291
    {
292
        $msg = null;
293
        // if other arrays are empty, then the array we're assigning must not be empty
294
        $count = count($this->scalarProperty) + count($this->complexProperty);
295
        if (!$this->isValidArrayOK(
296
            $condition,
297
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TConditionType',
298
            $msg,
299
            0 < $count ? 0 : 1
300
        )
301
        ) {
302
            throw new \InvalidArgumentException($msg);
303
        }
304
        $this->condition = $condition;
305
        return $this;
306
    }
307
308
    public function isOK(&$msg = null)

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
        ) {
124
            throw new \InvalidArgumentException($msg);
125
        }
126
        $this->scalarProperty = $scalarProperty;
127
        return $this;
128
    }
129
130
    /**
@@ 184-199 (lines=16) @@
181
     * @param  \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TFunctionImportConditionType[] $condition
182
     * @return self
183
     */
184
    public function setCondition(array $condition)
185
    {
186
        $msg = null;
187
        // if other arrays are empty, then the array we're assigning must not be empty
188
        $count = count($this->scalarProperty);
189
        if (!$this->isValidArrayOK(
190
            $condition,
191
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TFunctionImportConditionType',
192
            $msg,
193
            0 < $count ? 0 : 1
194
        )
195
        ) {
196
            throw new \InvalidArgumentException($msg);
197
        }
198
        $this->condition = $condition;
199
        return $this;
200
    }
201
202
    public function isOK(&$msg = null)