We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 17 | class KeyNested extends AbstractRelated |
||
| 18 | { |
||
| 19 | 13 | public function hasReference($input) |
|
| 20 | { |
||
| 21 | try { |
||
| 22 | 13 | $this->getReferenceValue($input); |
|
| 23 | 13 | } catch (ComponentException $cex) { |
|
| 24 | 6 | return false; |
|
| 25 | } |
||
| 26 | |||
| 27 | 7 | return true; |
|
| 28 | } |
||
| 29 | |||
| 30 | 9 | private function getReferencePieces() |
|
| 34 | |||
| 35 | 7 | private function getKeyValueFromArray($array, $key) |
|
| 36 | { |
||
| 37 | 7 | if (!array_key_exists($key, $array)) { |
|
| 38 | 1 | $message = sprintf('Cannot select the key %s from the given array', $this->reference); |
|
| 39 | 1 | throw new ComponentException($message); |
|
| 40 | } |
||
| 41 | |||
| 42 | 6 | return $array[$key]; |
|
| 43 | } |
||
| 44 | |||
| 45 | 2 | private function getKeyValueFromObject($object, $property) |
|
| 46 | { |
||
| 47 | 2 | if (empty($property) || !property_exists($object, $property)) { |
|
| 48 | 1 | $message = sprintf('Cannot select the property %s from the given object', $this->reference); |
|
| 49 | 1 | throw new ComponentException($message); |
|
| 50 | } |
||
| 51 | |||
| 52 | 1 | return $object->{$property}; |
|
| 53 | } |
||
| 54 | |||
| 55 | 9 | private function getKeyValue($value, $key) |
|
| 68 | |||
| 69 | 13 | public function getReferenceValue($input) |
|
| 70 | { |
||
| 84 | } |
||
| 85 |