Passed
Push — master ( 80ef44...3a17ef )
by Joe Nilson
03:29 queued 12s
created

DgiiExport::addTablePage()   A

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