ArrayProxy   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 45
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A offsetUnset() 0 5 1
A offsetExists() 0 5 1
A offsetGet() 0 5 1
A offsetSet() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
/**
5
 * soluble-japha / PHPJavaBridge driver client.
6
 *
7
 * Refactored version of phpjababridge's Java.inc file compatible
8
 * with php java bridge 6.2
9
 *
10
 *
11
 * @credits   http://php-java-bridge.sourceforge.net/pjb/
12
 *
13
 * @see      http://github.com/belgattitude/soluble-japha
14
 *
15
 * @author Jost Boekemeier
16
 * @author Vanvelthem Sébastien (refactoring and fixes from original implementation)
17
 * @license   MIT
18
 *
19
 * The MIT License (MIT)
20
 * Copyright (c) 2014-2017 Jost Boekemeier
21
 * Permission is hereby granted, free of charge, to any person obtaining a copy
22
 * of this software and associated documentation files (the "Software"), to deal
23
 * in the Software without restriction, including without limitation the rights
24
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
 * copies of the Software, and to permit persons to whom the Software is
26
 * furnished to do so, subject to the following conditions:
27
 *
28
 * The above copyright notice and this permission notice shall be included in
29
 * all copies or substantial portions of the Software.
30
 *
31
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
37
 * THE SOFTWARE.
38
 */
39
40
namespace Soluble\Japha\Bridge\Driver\Pjb62;
41
42
class ArrayProxy extends IteratorProxy
43
{
44
    /**
45
     * @param string $idx
46
     *
47
     * @return bool
48
     */
49 2
    public function offsetExists($idx): bool
50
    {
51 2
        $ar = [$this, $idx];
52
53 2
        return $this->__client->invokeMethod(0, 'offsetExists', $ar);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->__client->...0, 'offsetExists', $ar) returns the type Soluble\Japha\Bridge\Driver\Pjb62\JavaType which is incompatible with the type-hinted return boolean.
Loading history...
54
    }
55
56
    /**
57
     * @param string|int $idx
58
     *
59
     * @return mixed
60
     */
61 4
    public function offsetGet($idx)
62
    {
63 4
        $ar = [$this, $idx];
64
65 4
        return $this->__client->invokeMethod(0, 'offsetGet', $ar);
66
    }
67
68
    /**
69
     * @param string|int $idx
70
     * @param mixed      $val
71
     */
72 3
    public function offsetSet($idx, $val)
73
    {
74 3
        $ar = [$this, $idx, $val];
75
76 3
        return $this->__client->invokeMethod(0, 'offsetSet', $ar);
77
    }
78
79
    /**
80
     * @param string|int $idx
81
     */
82 1
    public function offsetUnset($idx)
83
    {
84 1
        $ar = [$this, $idx];
85
86 1
        return $this->__client->invokeMethod(0, 'offsetUnset', $ar);
87
    }
88
}
89