1 | <?php |
||
2 | |||
3 | namespace olvlvl\ElasticsearchDSL\Query\Helpers; |
||
4 | |||
5 | trait JsonSerializeAsSimpleOrExtended |
||
6 | { |
||
7 | private function jsonSerializeAsSimpleOrExtended(string $property = 'value') |
||
8 | { |
||
9 | $options = parent::jsonSerialize(); |
||
10 | |||
11 | if ($options) { |
||
12 | return [ static::NAME => [ $this->field => [ $property => $this->$property ] + $options ] ]; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
13 | } |
||
14 | |||
15 | return [ static::NAME => [ $this->field => $this->$property ] ]; |
||
16 | } |
||
17 | } |
||
18 |