Code Duplication    Length = 13-13 lines in 2 locations

Subscribers/CustomerGroup.php 1 location

@@ 129-141 (lines=13) @@
126
     *
127
     * @return int|null
128
     */
129
    private function getConnectCustomerGroupId()
130
    {
131
        $repo = $this->modelManager->getRepository('Shopware\Models\Attribute\CustomerGroup');
132
        /** @var \Shopware\Models\Attribute\CustomerGroup $model */
133
        $model = $repo->findOneBy(['connectGroup' => true]);
134
135
        $customerGroup = null;
136
        if ($model && $model->getCustomerGroup()) {
137
            return $model->getCustomerGroup()->getId();
138
        }
139
140
        return null;
141
    }
142
}
143

Subscribers/Article.php 1 location

@@ 529-541 (lines=13) @@
526
    /**
527
     * @return \Shopware\Models\Customer\Group|null
528
     */
529
    public function getConnectCustomerGroup()
530
    {
531
        $repo = $this->modelManager->getRepository(CustomerGroupAttribute::class);
532
        /** @var \Shopware\Models\Attribute\CustomerGroup $model */
533
        $model = $repo->findOneBy(['connectGroup' => true]);
534
535
        $customerGroup = null;
536
        if ($model && $model->getCustomerGroup()) {
537
            return $model->getCustomerGroup();
538
        }
539
540
        return null;
541
    }
542
543
    /**
544
     * Load article detail