Code Duplication    Length = 17-19 lines in 5 locations

main/inc/lib/TicketManager.php 5 locations

@@ 1872-1889 (lines=18) @@
1869
    /**
1870
     * @return array
1871
     */
1872
    public static function getProjects()
1873
    {
1874
        $projects = Database::getManager()->getRepository('ChamiloTicketBundle:Project')->findAll();
1875
1876
        $list = [];
1877
        /** @var Project $row */
1878
        foreach ($projects as $row) {
1879
            $list[] = [
1880
                'id' => $row->getId(),
1881
                '0' => $row->getId(),
1882
                '1' => $row->getName(),
1883
                '2' => $row->getDescription(),
1884
                '3' => $row->getId()
1885
            ];
1886
        }
1887
1888
        return $list;
1889
    }
1890
1891
    /**
1892
     * @return array
@@ 1997-2015 (lines=19) @@
1994
    /**
1995
     * @return array
1996
     */
1997
    public static function getStatusAdminList()
1998
    {
1999
        $items = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll();
2000
2001
        $list = [];
2002
        /** @var Status $row */
2003
        foreach ($items as $row) {
2004
            $list[] = [
2005
                'id' => $row->getId(),
2006
                'code' => $row->getCode(),
2007
                '0' => $row->getId(),
2008
                '1' => $row->getName(),
2009
                '2' => $row->getDescription(),
2010
                '3' => $row->getId()
2011
            ];
2012
        }
2013
2014
        return $list;
2015
    }
2016
2017
    /**
2018
     * @return array
@@ 2020-2036 (lines=17) @@
2017
    /**
2018
     * @return array
2019
     */
2020
    public static function getStatusSimple()
2021
    {
2022
        $projects = Database::getManager()->getRepository('ChamiloTicketBundle:Status')->findAll();
2023
2024
        $list = [];
2025
        /** @var Project $row */
2026
        foreach ($projects as $row) {
2027
            $list[] = [
2028
                'id' => $row->getId(),
2029
                '0' => $row->getId(),
2030
                '1' => Display::url($row->getName()),
2031
                '2' => $row->getDescription()
2032
            ];
2033
        }
2034
2035
        return $list;
2036
    }
2037
2038
    /**
2039
     * @return int
@@ 2117-2135 (lines=19) @@
2114
    /**
2115
     * @return array
2116
     */
2117
    public static function getPriorityAdminList()
2118
    {
2119
        $items = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll();
2120
2121
        $list = [];
2122
        /** @var Status $row */
2123
        foreach ($items as $row) {
2124
            $list[] = [
2125
                'id' => $row->getId(),
2126
                'code' => $row->getCode(),
2127
                '0' => $row->getId(),
2128
                '1' => $row->getName(),
2129
                '2' => $row->getDescription(),
2130
                '3' => $row->getId()
2131
            ];
2132
        }
2133
2134
        return $list;
2135
    }
2136
2137
    /**
2138
     * @return array
@@ 2140-2156 (lines=17) @@
2137
    /**
2138
     * @return array
2139
     */
2140
    public static function getPrioritySimple()
2141
    {
2142
        $projects = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll();
2143
2144
        $list = [];
2145
        /** @var Priority $row */
2146
        foreach ($projects as $row) {
2147
            $list[] = [
2148
                'id' => $row->getId(),
2149
                '0' => $row->getId(),
2150
                '1' => Display::url($row->getName()),
2151
                '2' => $row->getDescription()
2152
            ];
2153
        }
2154
2155
        return $list;
2156
    }
2157
2158
    /**
2159
     * @return int