Code Duplication    Length = 72-73 lines in 3 locations

src/MetadataV3/edm/Groups/TOperationsTrait.php 1 location

@@ 8-79 (lines=72) @@
5
use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait;
6
use \AlgoWeb\ODataMetadata\MetadataV3\edm\TOnActionType;
7
8
trait TOperationsTrait
9
{
10
    use IsOKToolboxTrait;
11
    /**
12
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TOnActionType[] $onDelete
13
     */
14
    private $onDelete = [];
15
16
    /**
17
     * Adds as onDelete
18
     *
19
     * @return self
20
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TOnActionType $onDelete
21
     */
22
    public function addToOnDelete(TOnActionType $onDelete)
23
    {
24
        $this->onDelete[] = $onDelete;
25
        return $this;
26
    }
27
28
    /**
29
     * isset onDelete
30
     *
31
     * @param scalar $index
32
     * @return boolean
33
     */
34
    public function issetOnDelete($index)
35
    {
36
        return isset($this->onDelete[$index]);
37
    }
38
39
    /**
40
     * unset onDelete
41
     *
42
     * @param scalar $index
43
     * @return void
44
     */
45
    public function unsetOnDelete($index)
46
    {
47
        unset($this->onDelete[$index]);
48
    }
49
50
    /**
51
     * Gets as onDelete
52
     *
53
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TOnActionType[]
54
     */
55
    public function getOnDelete()
56
    {
57
        return $this->onDelete;
58
    }
59
60
    /**
61
     * Sets a new onDelete
62
     *
63
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TOnActionType[] $onDelete
64
     * @return self
65
     */
66
    public function setOnDelete(array $onDelete)
67
    {
68
        $this->onDelete = $onDelete;
69
        return $this;
70
    }
71
72
    public function isTOperationsOK(&$msg = null)
73
    {
74
        if (!$this->isValidArrayOK($this->onDelete, '\AlgoWeb\ODataMetadata\MetadataV3\edm\TOnActionType', $msg)) {
75
            return false;
76
        }
77
        return true;
78
    }
79
}
80

src/MetadataV3/edm/ssdl/Groups/TOperations.php 1 location

@@ 7-79 (lines=73) @@
4
5
use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait;
6
7
trait TOperations
8
{
9
    use IsOKToolboxTrait;
10
    
11
    /**
12
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl\TOnActionType[] $onDelete
13
     */
14
    private $onDelete = [];
15
16
    /**
17
     * Adds as onDelete
18
     *
19
     * @return self
20
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl\TOnActionType $onDelete
21
     */
22
    public function addToOnDelete(TOnActionType $onDelete)
23
    {
24
        $this->onDelete[] = $onDelete;
25
        return $this;
26
    }
27
28
    /**
29
     * isset onDelete
30
     *
31
     * @param scalar $index
32
     * @return boolean
33
     */
34
    public function issetOnDelete($index)
35
    {
36
        return isset($this->onDelete[$index]);
37
    }
38
39
    /**
40
     * unset onDelete
41
     *
42
     * @param scalar $index
43
     * @return void
44
     */
45
    public function unsetOnDelete($index)
46
    {
47
        unset($this->onDelete[$index]);
48
    }
49
50
    /**
51
     * Gets as onDelete
52
     *
53
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl\TOnActionType[]
54
     */
55
    public function getOnDelete()
56
    {
57
        return $this->onDelete;
58
    }
59
60
    /**
61
     * Sets a new onDelete
62
     *
63
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl\TOnActionType[] $onDelete
64
     * @return self
65
     */
66
    public function setOnDelete(array $onDelete)
67
    {
68
        $this->onDelete = $onDelete;
69
        return $this;
70
    }
71
    
72
    public function isOperationsGroupOK(&$msg = null)
73
    {
74
        if (!$this->isValidArrayOK($this->onDelete, '\AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl\TOnActionType', $msg)) {
75
            return false;
76
        }
77
        return true;
78
    }
79
}

src/MetadataV3/edm/TAnonymousFunctionExpressionType/ParametersAnonymousType.php 1 location

@@ 12-84 (lines=73) @@
9
/**
10
 * Class representing ParametersAnonymousType
11
 */
12
class ParametersAnonymousType extends IsOK
13
{
14
    use IsOKToolboxTrait;
15
    /**
16
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionParameterType[] $parameter
17
     */
18
    private $parameter = [];
19
20
    /**
21
     * Adds as parameter
22
     *
23
     * @return self
24
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionParameterType $parameter
25
     */
26
    public function addToParameter(TFunctionParameterType $parameter)
27
    {
28
        $this->parameter[] = $parameter;
29
        return $this;
30
    }
31
32
    /**
33
     * isset parameter
34
     *
35
     * @param scalar $index
36
     * @return boolean
37
     */
38
    public function issetParameter($index)
39
    {
40
        return isset($this->parameter[$index]);
41
    }
42
43
    /**
44
     * unset parameter
45
     *
46
     * @param scalar $index
47
     * @return void
48
     */
49
    public function unsetParameter($index)
50
    {
51
        unset($this->parameter[$index]);
52
    }
53
54
    /**
55
     * Gets as parameter
56
     *
57
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionParameterType[]
58
     */
59
    public function getParameter()
60
    {
61
        return $this->parameter;
62
    }
63
64
    /**
65
     * Sets a new parameter
66
     *
67
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionParameterType[] $parameter
68
     * @return self
69
     */
70
    public function setParameter(array $parameter)
71
    {
72
        $this->parameter = $parameter;
73
        return $this;
74
    }
75
    
76
    public function isOK(&$msg = null)
77
    {
78
        return !$this->isValidArrayOK(
79
            $this->parameter,
80
            '\AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionParameterType',
81
            $msg
82
        );
83
    }
84
}
85