Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 790-792 (lines=3) @@
787
     */
788
    public function registerSale($itemId, $paymentType)
789
    {
790
        if (!in_array($paymentType, [self::PAYMENT_TYPE_PAYPAL, self::PAYMENT_TYPE_TRANSFER, self::PAYMENT_TYPE_CULQI])) {
791
            return false;
792
        }
793
794
        $entityManager = Database::getManager();
795
@@ 2125-2127 (lines=3) @@
2122
     */
2123
    public function registerServiceSale($serviceId, $paymentType, $infoSelect, $trial = null)
2124
    {
2125
        if (!in_array($paymentType, [self::PAYMENT_TYPE_PAYPAL, self::PAYMENT_TYPE_TRANSFER, self::PAYMENT_TYPE_CULQI])) {
2126
            return false;
2127
        }
2128
2129
        $userId = api_get_user_id();
2130