JasperReport::removeProperty()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Jasper report integration for PHP
7
 *
8
 * @link      https://github.com/belgattitude/soluble-jasper
9
 * @author    Vanvelthem Sébastien
10
 * @copyright Copyright (c) 2017-2019 Vanvelthem Sébastien
11
 * @license   MIT
12
 */
13
14
namespace Soluble\Jasper\Proxy\Engine;
15
16
use Soluble\Japha\Bridge\Adapter as BridgeAdapter;
17
use Soluble\Japha\Interfaces\JavaObject;
18
use Soluble\Jasper\Proxy\RemoteJavaObjectProxyInterface;
19
use Soluble\Jasper\Report;
20
21
class JasperReport implements RemoteJavaObjectProxyInterface
22
{
23
    /**
24
     * @var BridgeAdapter
25
     */
26
    private $ba;
27
28
    /**
29
     * @var JavaObject Java('net.sf.jasperreports.engine.JasperReport')
30
     */
31
    private $jasperReport;
32
33
    /**
34
     * @var Report
35
     */
36
    private $report;
37
38
    /**
39
     * @param JavaObject $jasperReport Java('net.sf.jasperreports.engine.JasperReport')
40
     * @param Report     $report       original report
41
     */
42 17
    public function __construct(BridgeAdapter $bridgeAdapter, JavaObject $jasperReport, Report $report)
43
    {
44 17
        $this->ba           = $bridgeAdapter;
45 17
        $this->jasperReport = $jasperReport;
46 17
        $this->report       = $report;
47 17
    }
48
49
    /**
50
     * Return original report.
51
     */
52 15
    public function getReport(): Report
53
    {
54 15
        return $this->report;
55
    }
56
57
    /**
58
     * @return mixed
59
     */
60 1
    public function getProperty(string $name)
61
    {
62 1
        return $this->jasperReport->getProperty($name);
63
    }
64
65
    /**
66
     * @param mixed $value
67
     */
68 1
    public function setProperty(string $name, $value): void
69
    {
70 1
        $this->jasperReport->setProperty($name, $value);
71 1
    }
72
73 1
    public function removeProperty(string $name): void
74
    {
75 1
        $this->jasperReport->removeProperty($name);
76 1
    }
77
78
    /**
79
     * @return string[]
80
     */
81 1
    public function getPropertyNames(): array
82
    {
83 1
        return $this->ba->values($this->jasperReport->getPropertyNames());
84
    }
85
86 1
    public function getResourceBundle(): ?string
87
    {
88 1
        return $this->jasperReport->getResourceBundle();
89
    }
90
91
    /**
92
     * @return JavaObject Java('net.sf.jasperreports.engine.JasperReport')
93
     */
94 16
    public function getJavaProxiedObject(): JavaObject
95
    {
96 16
        return $this->jasperReport;
97
    }
98
}
99