Completed
Push — develop-3.2 ( 5bcccf...9c48fd )
by Matt
03:48
created

bbcodes_migration_base::install_abbc3_bbcodes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
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\migrations;
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
	/**
24
	 * @var array An array of bbcodes data to install
25
	 */
26
	protected static $bbcode_data;
27
28
	/**
29
	 * Wrapper for installing bbcodes in migrations
30
	 */
31
	public function install_abbc3_bbcodes()
32
	{
33
		/** @var \phpbb\group\helper $group_helper */
34
		$group_helper = $this->container->get('group_helper');
35
36
		/** @var \phpbb\language\language $language */
37
		$language = $this->container->get('language');
38
39
		/** @var \phpbb\request\request $request */
40
		$request = $this->container->get('request');
41
42
		$bbcodes_installer = new \vse\abbc3\core\bbcodes_installer($this->db, $group_helper, $language, $request, $this->phpbb_root_path, $this->php_ext);
43
		$bbcodes_installer->install_bbcodes(static::$bbcode_data);
44
	}
45
}
46