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

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