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

Post::postDelete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
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