We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 10 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Argument implements ArgumentInterface |
||
| 8 | { |
||
| 9 | /** @var array */ |
||
| 10 | private $rawArguments = []; |
||
| 11 | |||
| 12 | 86 | public function __construct(?array $rawArguments = null) |
|
| 15 | 86 | } |
|
| 16 | |||
| 17 | 86 | public function exchangeArray($array): array |
|
| 18 | { |
||
| 19 | 86 | $old = $this->rawArguments; |
|
| 20 | 86 | $this->rawArguments = $array ?? []; |
|
| 21 | |||
| 22 | 86 | return $old; |
|
| 23 | } |
||
| 24 | |||
| 25 | 30 | public function getArrayCopy(): array |
|
| 26 | { |
||
| 27 | 30 | return $this->rawArguments; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return array |
||
| 32 | * |
||
| 33 | * @deprecated This method is deprecated since 0.12 and will be removed in 0.13. You should use getArrayCopy method instead. |
||
| 34 | */ |
||
| 35 | 1 | public function getRawArguments(): array |
|
| 36 | { |
||
| 37 | 1 | @\trigger_error( |
|
| 38 | 1 | \sprintf( |
|
| 39 | 1 | 'This "%s" method is deprecated since 0.12 and will be removed in 0.13. You should use "%s::getArrayCopy" instead.', |
|
| 40 | 1 | __METHOD__, |
|
| 41 | 1 | __CLASS__ |
|
| 42 | ), |
||
| 43 | 1 | \E_USER_DEPRECATED |
|
| 44 | ); |
||
| 45 | |||
| 46 | 1 | return $this->getArrayCopy(); |
|
| 47 | } |
||
| 48 | |||
| 49 | 50 | public function offsetExists($offset) |
|
| 50 | { |
||
| 51 | 50 | return \array_key_exists($offset, $this->rawArguments); |
|
| 52 | } |
||
| 53 | |||
| 54 | 48 | public function offsetGet($offset) |
|
| 55 | { |
||
| 56 | 48 | return $this->offsetExists($offset) ? $this->rawArguments[$offset] : null; |
|
| 57 | } |
||
| 58 | |||
| 59 | 1 | public function offsetSet($offset, $value): void |
|
| 60 | { |
||
| 61 | 1 | $this->rawArguments[$offset] = $value; |
|
| 62 | 1 | } |
|
| 63 | |||
| 64 | 1 | public function offsetUnset($offset): void |
|
| 65 | { |
||
| 66 | 1 | unset($this->rawArguments[$offset]); |
|
| 67 | 1 | } |
|
| 68 | |||
| 69 | 1 | public function count() |
|
| 72 | } |
||
| 73 | } |
||
| 74 |