Passed
Push — GENERAL_BUG_REVIEW_240911 ( c757bd...0ad96d )
by Rafael
45:56
created

ModelePDFUser   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A liste_modeles() 0 9 1
1
<?php
2
3
/* Copyright (C) 2003-2005  Rodolphe Quiedeville        <[email protected]>
4
 * Copyright (C) 2004-2010  Laurent Destailleur         <[email protected]>
5
 * Copyright (C) 2004       Eric Seigne                 <[email protected]>
6
 * Copyright (C) 2005-2012  Regis Houssin               <[email protected]>
7
 * Copyright (C) 2024       Rafael San José             <[email protected]>
8
 *
9
 * This program is free software; you can redistribute it and/or modify
10
 * it under the terms of the GNU General Public License as published by
11
 * the Free Software Foundation; either version 3 of the License, or
12
 * (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21
 * or see https://www.gnu.org/
22
 */
23
24
namespace Dolibarr\Code\User\Classes;
25
26
use Dolibarr\Code\Core\Classes\CommonDocGenerator;
27
28
/**
29
 *      \class      ModeleProductCode
30
 *      \brief      Parent class for product code generators
31
 */
32
33
/**
34
 *  \file       htdocs/core/modules/contract/modules_contract.php
35
 *  \ingroup    contract
36
 *  \brief      File with parent class for generating contracts to PDF and File of class to manage contract numbering
37
 */
38
39
/**
40
 *  Parent class to manage intervention document templates
41
 */
42
abstract class ModelePDFUser extends CommonDocGenerator
43
{
44
    /**
45
     * @var string Error code (or message)
46
     */
47
    public $error = '';
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
0 ignored issues
show
Bug introduced by
The type Dolibarr\Code\User\Classes\DoliDB was not found. Did you mean DoliDB? If so, make sure to prefix the type with \.
Loading history...
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 = 'user';
63
        $list = array();
64
65
        include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
66
        $list = getListOfModels($db, $type, $maxfilenamelength);
67
        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...
68
    }
69
}
70