Completed
Push — master ( 30892d...48871b )
by Matt
12s queued 11s
created

get_custom_sites_collection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
class customsitescollection
14
{
15
	/** @var \phpbb\extension\manager */
16
	protected $extension_manager;
17
18
	/**
19
	 * Constructor
20
	 *
21
	 * @param \phpbb\extension\manager $extension_manager
22
	 */
23
	public function __construct(\phpbb\extension\manager $extension_manager)
24
	{
25
		$this->extension_manager = $extension_manager;
26
	}
27
28
	/**
29
	 * Get a collection of custom JSON site definition files
30
	 *
31
	 * @return array Collection of JSON site definition files
32
	 */
33
	public function get_custom_sites_collection()
34
	{
35
		$finder = $this->extension_manager->get_finder();
36
37
		return $finder
38
			->set_extensions(array('phpbb/mediaembed'))
39
			->suffix('.json')
40
			->extension_directory('collection/sites')
41
			->get_files();
42
	}
43
}
44