Code Duplication    Length = 10-12 lines in 4 locations

main/inc/lib/userportal.lib.php 1 location

@@ 1999-2010 (lines=12) @@
1996
     * @param $listB
1997
     * @return int
1998
     */
1999
    public static function compareListUserCategory($listA, $listB)
2000
    {
2001
        if ($listA['title'] == $listB['title']) {
2002
            return 0;
2003
        }
2004
2005
        if ($listA['title'] > $listB['title']) {
2006
            return 1;
2007
        }
2008
2009
        return -1;
2010
    }
2011
2012
    /**
2013
     * @param $view

main/inc/lib/sessionmanager.lib.php 3 locations

@@ 8336-8345 (lines=10) @@
8333
     * @param array $listB
8334
     * @return int
8335
     */
8336
    private static function compareCatSessionInfo($listA, $listB)
8337
    {
8338
        if ($listA['sessionName'] == $listB['sessionName']) {
8339
            return 0;
8340
        } elseif ($listA['sessionName'] > $listB['sessionName']) {
8341
            return 1;
8342
        } else {
8343
            return -1;
8344
        }
8345
    }
8346
8347
    /**
8348
     * @param array $listA
@@ 8372-8381 (lines=10) @@
8369
     * @param array $listB
8370
     * @return int
8371
     */
8372
    private static function compareByUserCourseCat($listA, $listB)
8373
    {
8374
        if ($listA['courseInUserCategoryTitle'] == $listB['courseInUserCategoryTitle']) {
8375
            return 0;
8376
        } else if ($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) {
8377
            return 1;
8378
        } else {
8379
            return -1;
8380
        }
8381
    }
8382
8383
    /**
8384
     * @param array $listA
@@ 8388-8397 (lines=10) @@
8385
     * @param array $listB
8386
     * @return int
8387
     */
8388
    private static function compareByCourse($listA, $listB)
8389
    {
8390
        if ($listA['title'] == $listB['title']) {
8391
            return 0;
8392
        } else if ($listA['title'] > $listB['title']) {
8393
            return 1;
8394
        } else {
8395
            return -1;
8396
        }
8397
    }
8398
8399
    /**
8400
     * Return HTML code for displaying session_course_for_coach