1 | <?php |
||||||
2 | |||||||
3 | declare(strict_types=1); |
||||||
4 | |||||||
5 | namespace Damax\Common\Application; |
||||||
6 | |||||||
7 | use BadMethodCallException; |
||||||
8 | use Doctrine\Common\Inflector\Inflector; |
||||||
9 | |||||||
10 | trait AsArrayTrait |
||||||
11 | { |
||||||
12 | public function offsetExists($offset): bool |
||||||
13 | { |
||||||
14 | $prop = Inflector::camelize($offset); |
||||||
0 ignored issues
–
show
Deprecated Code
introduced
by
![]() |
|||||||
15 | |||||||
16 | return isset($this->$prop); |
||||||
17 | } |
||||||
18 | |||||||
19 | public function offsetGet($offset) |
||||||
20 | { |
||||||
21 | $prop = Inflector::camelize($offset); |
||||||
0 ignored issues
–
show
The function
Doctrine\Common\Inflector\Inflector::camelize() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
22 | |||||||
23 | return $this->$prop; |
||||||
24 | } |
||||||
25 | |||||||
26 | /** |
||||||
27 | * @throws BadMethodCallException |
||||||
28 | */ |
||||||
29 | public function offsetSet($offset, $value) |
||||||
0 ignored issues
–
show
The parameter
$offset is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$value is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
30 | { |
||||||
31 | throw new BadMethodCallException(sprintf('Method "%s" not implemented.', __METHOD__)); |
||||||
32 | } |
||||||
33 | |||||||
34 | /** |
||||||
35 | * @throws BadMethodCallException |
||||||
36 | */ |
||||||
37 | public function offsetUnset($offset) |
||||||
0 ignored issues
–
show
The parameter
$offset is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
38 | { |
||||||
39 | throw new BadMethodCallException(sprintf('Method "%s" not implemented.', __METHOD__)); |
||||||
40 | } |
||||||
41 | } |
||||||
42 |