Completed
Push — master ( 857f3b...9817b6 )
by Matt
18s
created

customsitescollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get_collection() 0 10 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
use phpbb\extension\manager;
14
15
class customsitescollection
16
{
17
	/** @var manager */
18
	protected $extension_manager;
19
20
	/**
21
	 * Constructor
22
	 *
23
	 * @param manager $extension_manager
24
	 */
25
	public function __construct(manager $extension_manager)
26
	{
27
		$this->extension_manager = $extension_manager;
28
	}
29
30
	/**
31
	 * Get a collection of custom YAML site definition files
32
	 *
33
	 * @return array Collection of YAML site definition files
34
	 */
35
	public function get_collection()
36
	{
37
		$finder = $this->extension_manager->get_finder();
38
39
		return $finder
40
			->set_extensions(array('phpbb/mediaembed'))
41
			->extension_suffix('.yml')
42
			->extension_directory('collection/sites')
43
			->get_files();
44
	}
45
}
46