Skip to content

Preferring the happy path #30

@szepeviktor

Description

@szepeviktor

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions