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

Post   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A postDeleteDefault() 0 7 2
A postDelete() 0 4 1
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