| @@ -10,9 +10,9 @@ | ||
| 10 | 10 | |
| 11 | 11 | class UsersRepository extends RepositoryAbstract { |
| 12 | 12 | |
| 13 | 13 | |
| 14 | - public function query( array $args = [], ?callable $transform = null ) { | |
| 14 | + public function query( array $args = [], callable $transform = null ) { | |
| 15 | 15 | $defaults = [ |
| 16 | 16 | 'number' => 20, |
| 17 | 17 | 'offset' => 0, |
| 18 | 18 | ]; |
| @@ -25,9 +25,9 @@ | ||
| 25 | 25 | * @param callable|null $transform |
| 26 | 26 | * |
| 27 | 27 | * @return bool|mixed|\WP_User |
| 28 | 28 | */ |
| 29 | - public function find( $id, ?callable $transform = null ) { | |
| 29 | + public function find( $id, callable $transform = null ) { | |
| 30 | 30 | |
| 31 | 31 | $user = get_user_by( 'id', $id ); |
| 32 | 32 | if ( ! is_null( $transform ) ) { |
| 33 | 33 | $user = call_user_func( $transform, $user ); |
| @@ -41,9 +41,9 @@ | ||
| 41 | 41 | * @param callable|null $transform |
| 42 | 42 | * |
| 43 | 43 | * @return array |
| 44 | 44 | */ |
| 45 | - public function find_where( array $args = [], ?callable $transform = null ) { | |
| 45 | + public function find_where( array $args = [], callable $transform = null ) { | |
| 46 | 46 | $users = $this->query( $args )->get_results(); |
| 47 | 47 | if ( ! is_null( $transform ) ) { |
| 48 | 48 | $users = array_map( $transform, $users ); |
| 49 | 49 | } |
| @@ -55,9 +55,9 @@ | ||
| 55 | 55 | * @param callable|null $transform |
| 56 | 56 | * |
| 57 | 57 | * @return Pager |
| 58 | 58 | */ |
| 59 | - public function paginate( array $args = [], ?callable $transform = null ) { | |
| 59 | + public function paginate( array $args = [], callable $transform = null ) { | |
| 60 | 60 | $query = $this->query( $args ); |
| 61 | 61 | |
| 62 | 62 | $pager = new Pager( |
| 63 | 63 | $query->get_results(), |
| @@ -75,9 +75,9 @@ | ||
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | 77 | * @return \WP_User |
| 78 | 78 | */ |
| 79 | - public function current( ?callable $transform = null ) { | |
| 79 | + public function current( callable $transform = null ) { | |
| 80 | 80 | $current_user = wp_get_current_user(); |
| 81 | 81 | $data = $this->find( $current_user->ID, $transform ); |
| 82 | 82 | |
| 83 | 83 | if ( $transform ) { |