DgiiExport::addModelPage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 3
rs 10
1
<?php
2
/*
3
 * Copyright (C) 2022 Joe Nilson <[email protected]>
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU Lesser General Public License as
7
 * published by the Free Software Foundation, either version 3 of the
8
 * License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU Lesser General Public License for more details.
14
 * You should have received a copy of the GNU Lesser General Public License
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 */
17
18
namespace FacturaScripts\Plugins\fsRepublicaDominicana\Lib\Export;
19
20
use FacturaScripts\Core\Response;
0 ignored issues
show
Bug introduced by
The type FacturaScripts\Core\Response was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
21
use FacturaScripts\Core\Tools;
22
23
use FacturaScripts\Dinamic\Lib\Export\ExportBase;
0 ignored issues
show
Bug introduced by
The type FacturaScripts\Dinamic\Lib\Export\ExportBase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
24
25
class DgiiExport extends ExportBase
26
{
27
    /**
28
     * @inheritDoc
29
     */
30
    public function addBusinessDocPage($model): bool
31
    {
32
        return false;
33
    }
34
35
    /**
36
     * @inheritDoc
37
     */
38
    public function addListModelPage($model, $where, $order, $offset, $columns, $title = ''): bool
39
    {
40
        return true;
41
    }
42
43
    /**
44
     * @inheritDoc
45
     */
46
    public function addModelPage($model, $columns, $title = ''): bool
47
    {
48
        return true;
49
    }
50
51
    /**
52
     * @inheritDoc
53
     */
54
    public function addTablePage($headers, $rows, $options = [], $title = ''): bool
55
    {
56
        return true;
57
    }
58
59
    /**
60
     * @inheritDoc
61
     */
62
    public function getDoc()
63
    {
64
        return '';
65
    }
66
67
    /**
68
     * @inheritDoc
69
     */
70
    public function newDoc(string $title, int $idformat, string $langcode)
71
    {
72
        // TODO: Implement newDoc() method.
73
    }
74
75
    /**
76
     * @inheritDoc
77
     */
78
    public function setOrientation(string $orientation)
79
    {
80
        // TODO: Implement setOrientation() method.
81
    }
82
83
    /**
84
     * @inheritDoc
85
     */
86
    public function show(Response &$response)
87
    {
88
        $response->headers->set('Content-Type', 'text/text; charset=utf-8');
89
        $response->headers->set('Content-Disposition', 'attachment;filename=' . $this->getFileName() . '.TXT');
90
        $response->setContent($this->getDoc());
91
    }
92
}