Completed
Push — master ( f7d051...7cf7a4 )
by Sébastien
03:48
created

JasperCompileManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
dl 0
loc 35
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1
ccs 7
cts 9
cp 0.7778
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A compileReport() 0 6 1
A getJavaProxiedObject() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Soluble\Jasper\Proxy\V6;
6
7
use Soluble\Japha\Bridge\Adapter as BridgeAdapter;
8
use Soluble\Japha\Interfaces\JavaObject;
9
use Soluble\Jasper\Proxy\RemoteJavaObjectProxyInterface;
10
11
class JasperCompileManager implements RemoteJavaObjectProxyInterface
12
{
13
    /**
14
     * @var BridgeAdapter
15
     */
16
    protected $ba;
17
18
    /**
19
     * @var \Soluble\Japha\Interfaces\JavaClass
20
     */
21
    protected $compileManager;
22
23 1
    public function __construct(BridgeAdapter $bridgeAdapter)
24
    {
25 1
        $this->ba = $bridgeAdapter;
26 1
        $this->compileManager = $this->ba->javaClass('net.sf.jasperreports.engine.JasperCompileManager');
27 1
    }
28
29
    /**
30
     * @param string $reportFile
31
     *
32
     * @return JavaObject Java('net.sf.jasperreports.engine.JasperReport')
33
     */
34 1
    public function compileReport(string $reportFile): JavaObject
35
    {
36 1
        $compiledReport = $this->compileManager->compileReport($reportFile);
37
38 1
        return $compiledReport;
39
    }
40
41
    public function getJavaProxiedObject(): JavaObject
42
    {
43
        return $this->compileManager;
44
    }
45
}
46