← All changes
|
backend/src/Data/Repository/AttachmentsRepository.php
+4
-4
0.4.2
→
1.5.5.1
View file →
| @@ -20,9 +20,9 @@ | ||
| 20 | 20 | * @param callable|null $transform |
| 21 | 21 | * |
| 22 | 22 | * @return array |
| 23 | 23 | */ |
| 24 | - public function find_where( array $args = [], callable $transform = null ) { | |
| 24 | + public function find_where( array $args = [], ?callable $transform = null ) { | |
| 25 | 25 | $query = $this->query( $args ); |
| 26 | 26 | $attachments = $query->posts; |
| 27 | 27 | if ( ! is_null( $transform ) ) { |
| 28 | 28 | $attachments = array_map( $transform, $attachments ); |
| @@ -59,9 +59,9 @@ | ||
| 59 | 59 | return $this; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | - public function restore( $id, callable $transform = null ) { | |
| 63 | + public function restore( $id, ?callable $transform = null ) { | |
| 64 | 64 | wp_untrash_post( $id ); |
| 65 | 65 | if ( ! is_null( $transform ) ) { |
| 66 | 66 | return $this->find( $id, $transform ); |
| 67 | 67 | } |
| @@ -74,9 +74,9 @@ | ||
| 74 | 74 | * @param callable|null $transform |
| 75 | 75 | * |
| 76 | 76 | * @return array|\WP_Post|null |
| 77 | 77 | */ |
| 78 | - public function find( $id, callable $transform = null ) { | |
| 78 | + public function find( $id, ?callable $transform = null ) { | |
| 79 | 79 | $attachment = get_post( $id ); |
| 80 | 80 | if ( ! is_null( $transform ) ) { |
| 81 | 81 | $attachment = call_user_func( $transform, $attachment ); |
| 82 | 82 | } |
| @@ -89,9 +89,9 @@ | ||
| 89 | 89 | * @param callable|null $transform |
| 90 | 90 | * |
| 91 | 91 | * @return Pager |
| 92 | 92 | */ |
| 93 | - public function paginate( array $args = [], callable $transform = null ) { | |
| 93 | + public function paginate( array $args = [], ?callable $transform = null ) { | |
| 94 | 94 | $query = $this->query( $args ); |
| 95 | 95 | |
| 96 | 96 | $pager = new Pager( |
| 97 | 97 | $query->posts, |