Skip to content

Commit

Permalink
Address phpstan level 1-5 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfelt committed Aug 10, 2023
1 parent 3406c63 commit b354345
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions includes/post-type-note.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ function register_meta() {
* Note: There's nothing horrible about allowing more blocks. Unhooking this
* function from the `allowed_block_types` filter won't cause any trouble.
*
* @param bool|array $allowed_block_types A list of allowed block types. Boolean true by default.
* @param \WP_Post $post The current note.
* @return array A modified list of allowed block types.
* @param bool|string[] $allowed_block_types A list of allowed block types. Boolean true by default.
* @param \WP_Post $post The current note.
* @return bool|string[] A modified list of allowed block types.
*/
function filter_allowed_block_types( $allowed_block_types, \WP_Post $post ) {
if ( get_slug() === $post->post_type ) {
Expand Down Expand Up @@ -408,10 +408,10 @@ function get_note_by_post_name( string $post_name ): int {
}

/**
* Parse and move anchors to the end of post content.
* Extract a list of links from note content.
*
* @param string $html The post content.
* @return array Modified post content.
* @param string $html The note content.
* @return string[] A list of links.
*/
function extract_links( string $html ): array {
preg_match_all( '/<a\s+(?:[^>]*?\s+)?href=(["\'])(.*?)\1/', $html, $matches );
Expand Down
3 changes: 2 additions & 1 deletion includes/share-on-mastodon.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
*
* @param array $args The args sent with a new Mastodon post.
* @param \WP_Post $post The post object.
* @return array Modified args.
*/
function filter_args( array $args, \WP_Post $post ) : array {
function filter_args( array $args, \WP_Post $post ): array {
if ( Note\get_slug() !== $post->post_type ) {
return $args;
}
Expand Down

0 comments on commit b354345

Please sign in to comment.