Code Duplication    Length = 14-15 lines in 2 locations

src/Repositories/ProductVarcharRepository.php 2 locations

@@ 118-132 (lines=15) @@
115
     *
116
     * @return array The varchar attributes
117
     */
118
    public function findAllByAttributeCodeAndEntityTypeIdAndStoreId($attributeCode, $entityTypeId, $storeId)
119
    {
120
121
        // prepare the params
122
        $params = array(
123
            MemberNames::ATTRIBUTE_CODE => $attributeCode,
124
            MemberNames::ENTITY_TYPE_ID => $entityTypeId,
125
            MemberNames::STORE_ID       => $storeId,
126
        );
127
128
        // load the entities and return them
129
        foreach ($this->getFinder(SqlStatementKeys::PRODUCT_VARCHAR_BY_ATTRIBUTE_CODE_AND_ENTITY_TYPE_ID_AND_STORE_ID)->find($params) as $result) {
130
            yield $result;
131
        }
132
    }
133
134
    /**
135
     * Load's and return's the varchar attribute with the passed params.
@@ 144-157 (lines=14) @@
141
     *
142
     * @return array|null The varchar attribute
143
     */
144
    public function findOneByAttributeCodeAndEntityTypeIdAndStoreIdAndValue($attributeCode, $entityTypeId, $storeId, $value)
145
    {
146
147
        // prepare the params
148
        $params = array(
149
            MemberNames::ATTRIBUTE_CODE => $attributeCode,
150
            MemberNames::ENTITY_TYPE_ID => $entityTypeId,
151
            MemberNames::STORE_ID       => $storeId,
152
            MemberNames::VALUE          => $value
153
        );
154
155
        // load and return the entity
156
        return $this->getFinder(SqlStatementKeys::PRODUCT_VARCHAR_BY_ATTRIBUTE_CODE_AND_ENTITY_TYPE_ID_AND_STORE_ID_AND_VALUE)->find($params);
157
    }
158
}
159