Code Duplication    Length = 3-3 lines in 2 locations

plugin/buycourses/src/buy_course_plugin.class.php 2 locations

@@ 810-812 (lines=3) @@
807
     */
808
    public function registerSale($itemId, $paymentType)
809
    {
810
        if (!in_array($paymentType, [self::PAYMENT_TYPE_PAYPAL, self::PAYMENT_TYPE_TRANSFER, self::PAYMENT_TYPE_CULQI])) {
811
            return false;
812
        }
813
814
        $entityManager = Database::getManager();
815
        $item = $this->getItem($itemId);
@@ 2162-2164 (lines=3) @@
2159
     */
2160
    public function registerServiceSale($serviceId, $paymentType, $infoSelect, $trial = null)
2161
    {
2162
        if (!in_array($paymentType, [self::PAYMENT_TYPE_PAYPAL, self::PAYMENT_TYPE_TRANSFER, self::PAYMENT_TYPE_CULQI])) {
2163
            return false;
2164
        }
2165
2166
        $userId = api_get_user_id();
2167
        $service = $this->getServices($serviceId);