Completed
Push — master ( 6a4efb...35b143 )
by Dennis
01:26
created

IconSvg   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A path() 0 3 1
A get() 0 7 2
1
<?php
2
3
namespace lloc\Msls\Component\Icon;
4
5
use lloc\Msls\Component\Icon;
6
7
/**
8
 * Class IconSvg
9
 * @package lloc\Msls\Component
10
 */
11
class IconSvg extends Icon {
12
13
	/**
14
	 * @return string
15
	 */
16
	protected function path(): string {
17
		return plugin_dir_path( MSLS_PLUGIN__FILE__ ) . 'css-flags/flags.php';
18
	}
19
20
	/**
21
	 * @param string $language
22
	 *
23
	 * @return string
24
	 */
25
	public function get( string $language ): string {
26
		if ( isset( $this->map[ $language ] ) ) {
27
			return $this->map[ $language ];
28
		}
29
30
		return $this->maybe( $language, 'flag-icon' );
31
	}
32
33
}