Code Duplication    Length = 15-15 lines in 3 locations

src/Observers/LinkAttributePositionUpdateObserver.php 3 locations

@@ 44-58 (lines=15) @@
41
     *
42
     * @return array The initialized product link attribute
43
     */
44
    protected function initializeProductLinkAttributeInt(array $attr)
45
    {
46
47
        // load link/product link attribute ID
48
        $linkId = $attr[MemberNames::LINK_ID];
49
        $productLinkAttributeId = $attr[MemberNames::PRODUCT_LINK_ATTRIBUTE_ID];
50
51
        // try to load the product link attribute integer value with the passed product link attribute/link ID
52
        if ($entity = $this->loadProductLinkAttributeInt($productLinkAttributeId, $linkId)) {
53
            return $this->mergeEntity($entity, $attr);
54
        }
55
56
        // simply return the attributes
57
        return $attr;
58
    }
59
60
    /**
61
     * Initialize the product link attribute with the passed attributes and returns an instance.
@@ 67-81 (lines=15) @@
64
     *
65
     * @return array The initialized product link attribute
66
     */
67
    protected function initializeProductLinkAttributeDecimal(array $attr)
68
    {
69
70
        // load link/product link attribute ID
71
        $linkId = $attr[MemberNames::LINK_ID];
72
        $productLinkAttributeId = $attr[MemberNames::PRODUCT_LINK_ATTRIBUTE_ID];
73
74
        // try to load the product link attribute decimal value with the passed product link attribute/link ID
75
        if ($entity = $this->loadProductLinkAttributeDecimal($productLinkAttributeId, $linkId)) {
76
            return $this->mergeEntity($entity, $attr);
77
        }
78
79
        // simply return the attributes
80
        return $attr;
81
    }
82
83
    /**
84
     * Initialize the product link attribute with the passed attributes and returns an instance.
@@ 90-104 (lines=15) @@
87
     *
88
     * @return array The initialized product link attribute
89
     */
90
    protected function initializeProductLinkAttributeVarchar(array $attr)
91
    {
92
93
        // load link/product link attribute ID
94
        $linkId = $attr[MemberNames::LINK_ID];
95
        $productLinkAttributeId = $attr[MemberNames::PRODUCT_LINK_ATTRIBUTE_ID];
96
97
        // try to load the product link attribute varchar value with the passed product link attribute/link ID
98
        if ($entity = $this->loadProductLinkAttributeVarchar($productLinkAttributeId, $linkId)) {
99
            return $this->mergeEntity($entity, $attr);
100
        }
101
102
        // simply return the attributes
103
        return $attr;
104
    }
105
106
    /**
107
     * Return's the product link attribute integer value with the passed product link attribute/link ID.