| @@ -17,9 +17,9 @@ | ||
| 17 | 17 | * @param $id |
| 18 | 18 | * |
| 19 | 19 | * @return array|\WP_Error|\WP_Term|null |
| 20 | 20 | */ |
| 21 | - public function find( $id, callable $transform = null ) { | |
| 21 | + public function find( $id, ?callable $transform = null ) { | |
| 22 | 22 | $term = get_term( $id ); |
| 23 | 23 | if ( ! is_null( $transform ) ) { |
| 24 | 24 | $term = call_user_func( $transform, $term ); |
| 25 | 25 | } |
| @@ -32,9 +32,9 @@ | ||
| 32 | 32 | * @param callable|null $transform |
| 33 | 33 | * |
| 34 | 34 | * @return array |
| 35 | 35 | */ |
| 36 | - public function find_where( array $args = [], callable $transform = null ) { | |
| 36 | + public function find_where( array $args = [], ?callable $transform = null ) { | |
| 37 | 37 | $terms = $this->query( $args )->get_terms(); |
| 38 | 38 | if ( ! is_null( $transform ) ) { |
| 39 | 39 | $terms = array_map( $transform, $terms ); |
| 40 | 40 | } |
| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | * @param callable|null $transform |
| 47 | 47 | * |
| 48 | 48 | * @return Pager |
| 49 | 49 | */ |
| 50 | - public function paginate( array $args = [], callable $transform = null ) { | |
| 50 | + public function paginate( array $args = [], ?callable $transform = null ) { | |
| 51 | 51 | $query = $this->query( $args ); |
| 52 | 52 | $total_terms = $this->terms_query_count( $query ); |
| 53 | 53 | |
| 54 | 54 | $pager = new Pager( |
| @@ -72,9 +72,9 @@ | ||
| 72 | 72 | * @param $children |
| 73 | 73 | * @param callable $transformer |
| 74 | 74 | * @return array |
| 75 | 75 | */ |
| 76 | - public function get_child_terms( $term, $children, callable $transformer = null ) { | |
| 76 | + public function get_child_terms( $term, $children, ?callable $transformer = null ) { | |
| 77 | 77 | if ( isset( $children[ $term->term_id ] ) ) { |
| 78 | 78 | $term_children = $children[ $term->term_id ]; |
| 79 | 79 | |
| 80 | 80 | foreach ( $term_children as $i => $child ) { |