Code Duplication    Length = 19-22 lines in 3 locations

src/MetadataV3/mapping/cs/TEndPropertyType.php 1 location

@@ 106-127 (lines=22) @@
103
        return $this;
104
    }
105
106
    public function isOK(&$msg = null)
107
    {
108
        if (!$this->isStringNotNullOrEmpty($this->name)) {
109
            $msg = 'Name cannot be null or empty';
110
            return false;
111
        }
112
        if (!$this->isTSimpleIdentifierValid($this->name)) {
113
            $msg = 'Name must be a valid TSimpleIdentifier';
114
            return false;
115
        }
116
        if (!$this->isValidArray(
117
            $this->scalarProperty,
118
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TScalarPropertyType'
119
        )) {
120
            $msg = "Scalar property array not a valid array";
121
            return false;
122
        }
123
        if (!$this->isChildArrayOK($this->scalarProperty, $msg)) {
124
            return false;
125
        }
126
        return true;
127
    }
128
}
129

src/MetadataV3/mapping/cs/TModificationFunctionMappingScalarPropertyType.php 1 location

@@ 100-119 (lines=20) @@
97
        return $this;
98
    }
99
100
    public function isOK(&$msg = null)
101
    {
102
        if (!$this->isStringNotNullOrEmpty($this->parameterName)) {
103
            $msg = "Parameter name cannot be null or empty";
104
            return false;
105
        }
106
        if (!$this->isStringNotNullOrEmpty($this->name)) {
107
            $msg = "Name cannot be null or empty";
108
            return false;
109
        }
110
        if (!$this->isTSimpleIdentifierValid($this->name)) {
111
            $msg = 'Name must be a valid TSimpleIdentifier';
112
            return false;
113
        }
114
        if (null != $this->version && !$this->isTVersionValid($this->version)) {
115
            $msg = "If set, version must be a valid TVersion";
116
            return false;
117
        }
118
        return true;
119
    }
120
}
121

src/MetadataV3/mapping/cs/TModificationFunctionMappingComplexPropertyType.php 1 location

@@ 131-149 (lines=19) @@
128
        return $this;
129
    }
130
131
    public function isOK(&$msg = null)
132
    {
133
        if (!$this->isStringNotNullOrEmpty($this->name)) {
134
            $msg = 'Name cannot be null or empty';
135
            return false;
136
        }
137
        if (!$this->isStringNotNullOrEmpty($this->typeName)) {
138
            $msg = 'Type name cannot be null or empty';
139
            return false;
140
        }
141
        if (!$this->isTSimpleIdentifierValid($this->name)) {
142
            $msg = 'Name must be a valid TSimpleIdentifier';
143
            return false;
144
        }
145
        if (!$this->isComplexPropertyPropertyGroupOK($msg)) {
146
            return false;
147
        }
148
        return true;
149
    }
150
}
151