Completed
Pull Request — develop (#1350)
by Naveen
03:25
created

Client_Factory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_client() 0 7 3
1
<?php
2
3
namespace Wordlift\Videoobject\Provider\Client;
4
/**
5
 * @since 3.30.0
6
 * @author Naveen Muthusamy <[email protected]>
7
 * This acts as factory for constructing api clients
8
 */
9
class Client_Factory {
10
11
	const YOUTUBE = 'youtube';
12
13
	const VIMEO = 'vimeo';
14
15
	public static function get_client( $config ) {
16
		if ( self::YOUTUBE === $config ) {
17
			return Youtube_Client::get_instance();
18
		} else if ( self::VIMEO === $config ) {
19
			return Vimeo_Client::get_instance();
20
		}
21
	}
22
}