Passed
Push — GENERAL_BUG_REVIEW_240911 ( 3362b2...8cbbee )
by Rafael
49:13
created

ModelePDFProjects   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 32
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A liste_modeles() 0 10 1
1
<?php
2
3
/* Copyright (C) 2010-2014  Regis Houssin               <[email protected]>
4
 * Copyright (C) 2014       Marcos García               <[email protected]>
5
 * Copyright (C) 2024       Rafael San José             <[email protected]>
6
 *
7
 * This program is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 3 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
 * or see https://www.gnu.org/
20
 */
21
22
namespace Dolibarr\Code\Projet\Classes;
23
24
use Dolibarr\Code\Core\Classes\CommonDocGenerator;
25
use DoliDB;
26
27
/**
28
 *      \file       htdocs/core/modules/project/modules_project.php
29
 *      \ingroup    project
30
 *      \brief      File that contain parent class for projects models
31
 *                  and parent class for projects numbering models
32
 */
33
34
/**
35
 *  Parent class for projects models
36
 */
37
abstract class ModelePDFProjects extends CommonDocGenerator
38
{
39
    /**
40
     * @var DoliDB Database handler
41
     */
42
    public $db;
43
44
    /**
45
     * @var string model description (short text)
46
     */
47
    public $description;
48
49
50
    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
51
52
    /**
53
     *  Return list of active generation modules
54
     *
55
     * @param DoliDB $db Database handler
56
     * @param integer $maxfilenamelength Max length of value to show
57
     * @return array                       List of templates
58
     */
59
    public static function liste_modeles($db, $maxfilenamelength = 0)
60
    {
61
        // phpcs:enable
62
        $type = 'project';
63
        $list = array();
64
65
        include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
66
        $list = getListOfModels($db, $type, $maxfilenamelength);
67
68
        return $list;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $list also could return the type integer which is incompatible with the documented return type array.
Loading history...
69
    }
70
}
71