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 Vanvelthem Sébastien |
11
|
|
|
* @license MIT |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Soluble\Jasper\Proxy\Export; |
15
|
|
|
|
16
|
|
|
use Soluble\Japha\Bridge\Adapter as BridgeAdapter; |
17
|
|
|
use Soluble\Japha\Interfaces\JavaObject; |
18
|
|
|
use Soluble\Jasper\Proxy\Engine\DefaultJasperReportsContext; |
19
|
|
|
use Soluble\Jasper\Proxy\RemoteJavaObjectProxyInterface; |
20
|
|
|
|
21
|
|
|
class SimplePdfExporterConfiguration implements RemoteJavaObjectProxyInterface |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var BridgeAdapter |
25
|
|
|
*/ |
26
|
|
|
private $ba; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var JavaObject Java('net.sf.jasperreports.export.SimplePdfExporterConfiguration') |
30
|
|
|
*/ |
31
|
|
|
private $config; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Create a local context, if no parentContext is given, assume the DefaultJasperReportsContext. |
35
|
|
|
* |
36
|
|
|
* @param BridgeAdapter $bridgeAdapter |
37
|
|
|
*/ |
38
|
3 |
|
public function __construct(BridgeAdapter $bridgeAdapter) |
39
|
|
|
{ |
40
|
3 |
|
$this->ba = $bridgeAdapter; |
|
|
|
|
41
|
3 |
|
$this->config = $this->ba->java( |
42
|
3 |
|
'net.sf.jasperreports.export.SimplePdfExporterConfiguration' |
43
|
|
|
); |
44
|
3 |
|
} |
45
|
|
|
|
46
|
2 |
|
public function setCompressed(bool $compressed): void |
47
|
|
|
{ |
48
|
2 |
|
$this->config->setCompressed($compressed); |
49
|
2 |
|
} |
50
|
|
|
|
51
|
1 |
|
public function setEncrypted(bool $encrypted): void |
52
|
|
|
{ |
53
|
1 |
|
$this->config->setEncrypted($encrypted); |
54
|
1 |
|
} |
55
|
|
|
|
56
|
1 |
|
public function set128BitKey(bool $use128BitKey): void |
57
|
|
|
{ |
58
|
1 |
|
$this->config->set128BitKey($use128BitKey); |
59
|
1 |
|
} |
60
|
|
|
|
61
|
1 |
|
public function setOwnerPassword(string $password): void |
62
|
|
|
{ |
63
|
1 |
|
$this->config->setOwnerPassword($password); |
64
|
1 |
|
} |
65
|
|
|
|
66
|
1 |
|
public function setUserPassword(string $password): void |
67
|
|
|
{ |
68
|
1 |
|
$this->config->setUserPassword($password); |
69
|
1 |
|
} |
70
|
|
|
|
71
|
2 |
|
public function setMetadataAuthor(string $author): void |
72
|
|
|
{ |
73
|
2 |
|
$this->config->setMetadataAuthor($author); |
74
|
2 |
|
} |
75
|
|
|
|
76
|
2 |
|
public function setMetadataCreator(string $creator): void |
77
|
|
|
{ |
78
|
2 |
|
$this->config->setMetadataCreator($creator); |
79
|
2 |
|
} |
80
|
|
|
|
81
|
1 |
|
public function setMetadataKeywords(string $keywords): void |
82
|
|
|
{ |
83
|
1 |
|
$this->config->setMetadataKeywords($keywords); |
84
|
1 |
|
} |
85
|
|
|
|
86
|
1 |
|
public function setMetadataSubject(string $subject): void |
87
|
|
|
{ |
88
|
1 |
|
$this->config->setMetadataSubject($subject); |
89
|
1 |
|
} |
90
|
|
|
|
91
|
1 |
|
public function setMetadataTitle(string $title): void |
92
|
|
|
{ |
93
|
1 |
|
$this->config->setMetadataTitle($title); |
94
|
1 |
|
} |
95
|
|
|
|
96
|
|
|
public function setPdfVersion(string $version): void |
97
|
|
|
{ |
98
|
|
|
$this->config->setPdfVersion($version); |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @return JavaObject Java('net.sf.jasperreports.export.SimplePdfExporterConfiguration') |
103
|
|
|
*/ |
104
|
3 |
|
public function getJavaProxiedObject(): JavaObject |
105
|
|
|
{ |
106
|
3 |
|
return $this->config; |
107
|
|
|
} |
108
|
|
|
} |
109
|
|
|
|
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.