Completed
Pull Request — master (#52)
by rxu
01:35
created

CustomSitesCollection   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_custom_sites_collection() 0 4 1
1
<?php
2
/**
3
 *
4
 * phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2019 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\mediaembed\collection;
12
13
/**
14
 * Collection of custom site definitions
15
 *
16
 * See https://s9etextformatter.readthedocs.io/Plugins/MediaEmbed/Add_custom/
17
 */
18
class CustomSitesCollection
19
{
20
	/** @var array $custom_sites_collection Custom site definitions */
21
	protected $custom_sites_collection = [
22
		'ok' =>
23
		[
24
			'host'    => 'ok.ru',
25
			'name'    => 'Odnoklassniki',
26
			'extract' => [
27
				'!ok.ru/video/(?<id>\\d+)!',
28
				'!ok.ru/live/(?<id>\\d+)!',
29
			],
30
			'iframe'  => ['src' => 'https://ok.ru/videoembed/{@id}']
31
		],
32
	];
33
34
	/**
35
	 * Get custom site definitions array for media embedding
36
	 *
37
	 * @return array An array of custom site definitions
38
	 */
39
	public function get_custom_sites_collection()
40
	{
41
		return $this->custom_sites_collection;
42
	}
43
}
44