Passed
Push — master ( a5e8db...945884 )
by Danny
02:33
created

Post::postDeleteDefault()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace PressCLI\WPCLI;
3
4
use PressCLI\WPCLI\CLI;
5
6
trait Post
7
{
8
    /**
9
     * Creates the database.
10
     */
11
    public static function postDeleteDefault()
12
    {
13
        $post_ids = [1, 2];
14
        foreach ($post_ids as $postId) {
15
            self::postDelete($postId);
16
        }
17
    }
18
19
    /**
20
     * Deletes a post by id..
21
     */
22
    public static function postDelete($postId)
23
    {
24
        CLI::execCommand('post', ['delete', $postId], ['force' => '']);
25
    }
26
}
27