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

ModelePDFProduct   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 19
rs 10
c 1
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		Frédéric France			    <[email protected]>
8
 * Copyright (C) 2024		MDW							<[email protected]>
9
 * Copyright (C) 2024       Rafael San José             <[email protected]>
10
 *
11
 * This program is free software; you can redistribute it and/or modify
12
 * it under the terms of the GNU General Public License as published by
13
 * the Free Software Foundation; either version 3 of the License, or
14
 * (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23
 * or see https://www.gnu.org/
24
 */
25
26
namespace Dolibarr\Code\Product\Classes;
27
28
use Dolibarr\Code\Core\Classes\CommonDocGenerator;
29
use DoliDB;
30
31
/**
32
 *  \file       htdocs/core/modules/product/modules_product.class.php
33
 *  \ingroup    contract
34
 *  \brief      File with parent class for generating products to PDF and File of class to manage product numbering
35
 */
36
37
/**
38
 *  Parent class to manage intervention document templates
39
 */
40
abstract class ModelePDFProduct extends CommonDocGenerator
41
{
42
    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
43
    /**
44
     *  Return list of active generation modules
45
     *
46
     * @param DoliDB $dbs Database handler
47
     * @param integer $maxfilenamelength Max length of value to show
48
     * @return array                       List of templates
49
     */
50
    public static function liste_modeles($dbs, $maxfilenamelength = 0)
51
    {
52
        // phpcs:enable
53
        $type = 'product';
54
        $list = array();
55
56
        include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
57
        $list = getListOfModels($dbs, $type, $maxfilenamelength);
58
        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...
59
    }
60
}
61