Completed
Push — master ( 6ea6d2...2b0f96 )
by Sébastien
04:47
created

ReportRunnerJapha   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 30
rs 10
c 0
b 0
f 0

3 Methods

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