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

ModelePDFMovement   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

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