Many methods suggest that it should fail: ends with the unhappy path.
e.g.
|
public static function delete_post( $oopi_id, $force_delete = true ) { |
|
$post_id = self::get_post_id_by_oopi_id( $oopi_id ); |
|
|
|
if ( $post_id ) { |
|
return wp_delete_post( $post_id, $force_delete ); |
|
} |
|
|
|
return false; |
|
} |
Would you welcome a PR like this?
if (error) unhappy path;
happy path;
source
Many methods suggest that it should fail: ends with the unhappy path.
e.g.
wp-oopi/src/Storage.php
Lines 131 to 139 in 9847ed3
Would you welcome a PR like this?
source