Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 832-834 (lines=3) @@
829
     */
830
    public function registerSale($itemId, $paymentType)
831
    {
832
        if (!in_array($paymentType, [self::PAYMENT_TYPE_PAYPAL, self::PAYMENT_TYPE_TRANSFER, self::PAYMENT_TYPE_CULQI])) {
833
            return false;
834
        }
835
836
        $entityManager = Database::getManager();
837
        $item = $this->getItem($itemId);
@@ 2184-2186 (lines=3) @@
2181
     */
2182
    public function registerServiceSale($serviceId, $paymentType, $infoSelect, $trial = null)
2183
    {
2184
        if (!in_array($paymentType, [self::PAYMENT_TYPE_PAYPAL, self::PAYMENT_TYPE_TRANSFER, self::PAYMENT_TYPE_CULQI])) {
2185
            return false;
2186
        }
2187
2188
        $userId = api_get_user_id();
2189
        $service = $this->getServices($serviceId);