CustomParsedown   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 3
cts 9
cp 0.3333
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A inlineLink() 0 12 2
1
<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
2
3
require_once APPPATH . '../vendor/erusev/parsedown/Parsedown.php';
4
class CustomParsedown extends Parsedown {
5 96
	public function __construct() {
6 96
		$this->setSafeMode(TRUE);
7 96
	}
8
9
	protected function inlineLink($excerpt) {
10
		$link = parent::inlineLink($excerpt);
11
12
		if(!isset($link)) {
13
			return null;
14
		}
15
16
		//Make title attribute the same as link
17
		$link['element']['attributes']['title'] = $link['element']['attributes']['href'];
18
19
		return $link;
20
	}
21
}
22