| Conditions | 4 |
| Paths | 5 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function get( $metaKey, array $args = [] ) |
||
|
|
|||
| 10 | { |
||
| 11 | if( empty( $metaKey ))return; |
||
| 12 | |||
| 13 | $args = $this->normalize( $args ); |
||
| 14 | $metaKey = $this->buildMetaKey( $metaKey, $args['prefix'] ); |
||
| 15 | $metaValue = get_post_meta( $args['id'], $metaKey, $args['single'] ); |
||
| 16 | |||
| 17 | if( is_string( $metaValue )) { |
||
| 18 | $metaValue = trim( $metaValue ); |
||
| 19 | } |
||
| 20 | return empty( $metaValue ) |
||
| 21 | ? $args['fallback'] |
||
| 22 | : $metaValue; |
||
| 23 | } |
||
| 24 | |||
| 43 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.