Completed
Push — master ( b3758e...d24b37 )
by Sébastien
04:19
created

JREmptyDataSource   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 27
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getJavaProxiedObject() 0 7 2
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\Engine;
15
16
use Soluble\Japha\Bridge\Adapter as BridgeAdapter;
17
use Soluble\Japha\Interfaces\JavaObject;
18
19
class JREmptyDataSource implements JRDataSourceInterface
20
{
21
    /**
22
     * @var BridgeAdapter
23
     */
24
    private $ba;
25
26
    /**
27
     * @var \Soluble\Japha\Interfaces\JavaObject
28
     */
29
    private $jrEmptyDataSource;
30
31 6
    public function __construct(BridgeAdapter $bridgeAdapter)
32
    {
33 6
        $this->ba = $bridgeAdapter;
34 6
    }
35
36
    /**
37
     * @return JavaObject Java('net.sf.jasperreports.engine.JREmptyDataSource')
38
     */
39 6
    public function getJavaProxiedObject(): JavaObject
40
    {
41 6
        if ($this->jrEmptyDataSource === null) {
42 6
            $this->jrEmptyDataSource = $this->ba->java('net.sf.jasperreports.engine.JREmptyDataSource');
43
        }
44
45 6
        return $this->jrEmptyDataSource;
46
    }
47
}
48