Completed
Push — develop-3.2.x ( 762012...85e047 )
by Matt
06:54
created

bbcodes_migration_base   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 23
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A install_abbc3_bbcodes() 0 14 1
1
<?php
2
/**
3
 *
4
 * Advanced BBCode Box
5
 *
6
 * @copyright (c) 2015 Matt Friedman
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace vse\abbc3\core;
12
13
use \phpbb\db\migration\container_aware_migration;
14
15
/**
16
 * Class wrapper for installing/updating bbcodes in migrations.
17
 * This class must be kept outside of the migrations directory
18
 * since this is not a migration file. It's just a wrapper that
19
 * can be extended by multiple migration files.
20
 */
21
abstract class bbcodes_migration_base extends container_aware_migration
22
{
23
	/** @var array An array of bbcodes data to install */
24
	protected $bbcode_data;
25
26
	/**
27
	 * Wrapper for installing bbcodes in migrations
28
	 */
29
	public function install_abbc3_bbcodes()
30
	{
31
		/** @var \phpbb\group\helper $group_helper */
32
		$group_helper = $this->container->get('group_helper');
33
34
		/** @var \phpbb\request\request $request */
35
		$request = $this->container->get('request');
36
37
		/** @var \phpbb\user $user */
38
		$user = $this->container->get('user');
39
40
		$bbcodes_installer = new \vse\abbc3\core\bbcodes_installer($this->db, $group_helper, $request, $user, $this->phpbb_root_path, $this->php_ext);
41
		$bbcodes_installer->install_bbcodes($this->bbcode_data);
42
	}
43
}
44