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

Client_Factory::get_client()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
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
}