Code Duplication    Length = 16-16 lines in 2 locations

src/Repositories/AttributeOptionRepository.php 1 location

@@ 114-129 (lines=16) @@
111
     *
112
     * @return array The EAV attribute option
113
     */
114
    public function findOneByEntityTypeIdAndAttributeCodeAndStoreIdAndSwatchAndType($entityTypeId, $attributeCode, $storeId, $swatch, $type)
115
    {
116
117
        // the parameters of the EAV attribute option to load
118
        $params = array(
119
            MemberNames::ENTITY_TYPE_ID => $entityTypeId,
120
            MemberNames::ATTRIBUTE_CODE => $attributeCode,
121
            MemberNames::STORE_ID       => $storeId,
122
            MemberNames::VALUE          => $swatch,
123
            MemberNames::TYPE           => $type
124
        );
125
126
        // load and return the EAV attribute option with the passed parameters
127
        $this->attributeOptionByEntityTypeIdAndAttributeCodeAndStoreIdAndSwatchAndTypeStmt->execute($params);
128
        return $this->attributeOptionByEntityTypeIdAndAttributeCodeAndStoreIdAndSwatchAndTypeStmt->fetch(\PDO::FETCH_ASSOC);
129
    }
130
131
    /**
132
     * Returns the EAV attribute option of attribute with the passed ID with the highest sort order.

src/Repositories/AttributeOptionSwatchRepository.php 1 location

@@ 103-118 (lines=16) @@
100
     *
101
     * @return array The EAV attribute option swatch
102
     */
103
    public function findOneByEntityTypeIdAndAttributeCodeAndStoreIdAndValueAndType($entityTypeId, $attributeCode, $storeId, $value, $type)
104
    {
105
106
        // the parameters of the EAV attribute option to load
107
        $params = array(
108
            MemberNames::ENTITY_TYPE_ID => $entityTypeId,
109
            MemberNames::ATTRIBUTE_CODE => $attributeCode,
110
            MemberNames::STORE_ID       => $storeId,
111
            MemberNames::VALUE          => $value,
112
            MemberNames::TYPE           => $type
113
        );
114
115
        // load and return the EAV attribute option swatch with the passed parameters
116
        $this->attributeOptionSwatchByEntityTypeIdAndAttributeCodeAndStoreIdAndValueAndTypeStmt->execute($params);
117
        return $this->attributeOptionSwatchByEntityTypeIdAndAttributeCodeAndStoreIdAndValueAndTypeStmt->fetch(\PDO::FETCH_ASSOC);
118
    }
119
}
120