Completed
Push — master ( ac1295...0765b1 )
by Seth
01:58
created

WordPressPest::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace smtech\StMarksSearch\WordPress;
4
5
use Battis\Educoder\PestJSON;
6
7
class WordPressPest extends PestJSON
8
{
9
    public function __construct($url)
10
    {
11
        if (!preg_match('%.*/wp-json/wp/v\d+$%', $url)) {
12
            $url = "$url/wp-json/wp/v2";
13
        }
14
        parent::__construct($url);
15
    }
16
}
17